web: add fullHeight toggle to empty state, add dark empty state

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-17 18:49:55 +01:00
parent 5f0192ee48
commit bf32cf3265
3 changed files with 15 additions and 4 deletions

View File

@ -77,6 +77,7 @@ ak-message {
--pf-global--Color--100: var(--ak-dark-foreground); --pf-global--Color--100: var(--ak-dark-foreground);
--pf-c-page__main-section--m-light--BackgroundColor: var(--ak-dark-background-darker); --pf-c-page__main-section--m-light--BackgroundColor: var(--ak-dark-background-darker);
--pf-global--link--Color: var(--ak-dark-foreground-link); --pf-global--link--Color: var(--ak-dark-foreground-link);
--pf-global--BackgroundColor--light-300: var(--ak-dark-background);
} }
/* Global page background colour */ /* Global page background colour */
.pf-c-page { .pf-c-page {
@ -131,6 +132,10 @@ ak-message {
.pf-c-table__expandable-row.pf-m-expanded { .pf-c-table__expandable-row.pf-m-expanded {
--pf-c-table__expandable-row--m-expanded--BorderBottomColor: var(--ak-dark-background-lighter); --pf-c-table__expandable-row--m-expanded--BorderBottomColor: var(--ak-dark-background-lighter);
} }
/* tabs */
.pf-c-tabs {
background-color: var(--ak-dark-background-light);
}
/* tabs, vertical */ /* tabs, vertical */
.pf-c-tabs.pf-m-vertical .pf-c-tabs__link { .pf-c-tabs.pf-m-vertical .pf-c-tabs__link {
background-color: var(--ak-dark-background-light); background-color: var(--ak-dark-background-light);

View File

@ -2,6 +2,7 @@ import { CSSResult, customElement, html, LitElement, property, TemplateResult }
import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css"; import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFTitle from "@patternfly/patternfly/components/Title/title.css";
import AKGlobal from "../authentik.css";
import { SpinnerSize } from "./Spinner"; import { SpinnerSize } from "./Spinner";
@ -14,15 +15,18 @@ export class EmptyState extends LitElement {
@property({type: Boolean}) @property({type: Boolean})
loading = false; loading = false;
@property({type: Boolean})
fullHeight = false;
@property() @property()
header?: string; header: string = "";
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFEmptyState, PFTitle]; return [PFBase, PFEmptyState, PFTitle, AKGlobal];
} }
render(): TemplateResult { render(): TemplateResult {
return html`<div class="pf-c-empty-state"> return html`<div class="pf-c-empty-state ${this.fullHeight && 'pf-m-full-height'}">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
${this.loading ? ${this.loading ?
html`<div class="pf-c-empty-state__icon"> html`<div class="pf-c-empty-state__icon">

View File

@ -2,6 +2,7 @@ import { css, CSSResult, customElement, html, LitElement, property, TemplateResu
import { Route } from "./Route"; import { Route } from "./Route";
import { ROUTES } from "../../routes"; import { ROUTES } from "../../routes";
import { RouteMatch } from "./RouteMatch"; import { RouteMatch } from "./RouteMatch";
import AKGlobal from "../../authentik.css";
import "../../pages/generic/SiteShell"; import "../../pages/generic/SiteShell";
import "./Router404"; import "./Router404";
@ -15,10 +16,11 @@ export class RouterOutlet extends LitElement {
defaultUrl?: string; defaultUrl?: string;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [ return [AKGlobal,
css` css`
:host { :host {
height: 100vh; height: 100vh;
background-color: var(--pf-c-page--BackgroundColor) !important;
} }
*:first-child { *:first-child {
height: 100%; height: 100%;