/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { css } from 'lit'; import { utilityControlStyles } from '../internal/app-shell-utility-control-styles'; /** AppShell CSS: a grid of banner, top bar, side-nav track and content column, whose flex row holds the container, aside and docked AI panel. */ export const styles = css` :host { /* Geometry: design tokens where one exists, bare pixels where none does. */ /* The nav track mirrors nile-side-bar's own width expressions (enterprise 240/70, NxtGen 296/68); keep in step with nile-side-bar.css.ts. */ --nile-app-shell-side-nav-width: var( --nile-width-240px, var(--ng-spacing-296, 240px) ); --nile-app-shell-side-nav-rail-width: var( --nile-width-70px, var(--ng-spacing-68, 70px) ); --nile-app-shell-gutter: var(--nile-spacing-xs, var(--ng-spacing-xs)); --nile-app-shell-content-padding: var( --nile-spacing-3xl, var(--ng-spacing-3xl) ); --nile-app-shell-top-bar-height: 68px; /* The panel header keeps its own height, distinct from the page header. */ --nile-app-shell-panel-header-height: 56px; --nile-app-shell-tabs-height: 33px; /* The leading app icon is its own 20px size, not the 32px utility box. */ --nile-app-shell-app-icon-size: 20px; --nile-app-shell-panel-width: 480px; --nile-app-shell-panel-min-width: 360px; --nile-app-shell-aside-width: 320px; --nile-app-shell-aside-min-width: 240px; --nile-app-shell-content-min-width: 640px; --nile-app-shell-min-width: 768px; --nile-app-shell-centered-width: 824px; /* Both tokens are 32px; the literal is the floor with no theme sheet loaded. */ --nile-app-shell-utility-size: var( --nile-spacing-4xl, var(--ng-spacing-4xl, 32px) ); --nile-app-shell-radius: var(--nile-radius-xl, var(--ng-radius-2xl)); --nile-app-shell-duration: var( --nile-transition-duration-default, var(--ng-transition-duration-default) ); /* NxtGen ships no easing tokens, so the shell names its own. */ --nile-app-shell-ease: cubic-bezier(0.2, 0, 0, 1); --_side-nav-track: var(--nile-app-shell-side-nav-width); position: relative; box-sizing: border-box; display: grid; grid-template-areas: 'banner banner' 'top-bar top-bar' 'side-nav content'; grid-template-columns: var(--_side-nav-track) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); /* Below this the window scrolls rather than the shell compressing. */ min-width: var(--nile-app-shell-min-width); height: 100%; overflow: hidden; background: var(--nile-colors-neutral-100, var(--ng-colors-bg-tertiary)); color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900)); font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body)); transition: grid-template-columns var(--nile-app-shell-duration) var(--nile-app-shell-ease); } :host([hidden]) { display: none; } :host([full-height]) { height: 100dvh; } /* Effective rail state: the user's preference, or a forced rail when narrow. */ :host([rail]) { --_side-nav-track: var(--nile-app-shell-side-nav-rail-width); } :host(:not([has-side-nav])) { --_side-nav-track: 0px; } /* The Description axis: a present description adds the 8px its second line occupies. */ :host([has-description]) { --nile-app-shell-top-bar-height: 76px; } /* The top bar compresses before the content does. */ @media (max-height: 600px) { :host { --nile-app-shell-top-bar-height: 56px; } :host([has-description]) { --nile-app-shell-top-bar-height: 64px; } } /* ---------------------------------------------------------------- banner */ .banner { grid-area: banner; min-width: 0; } :host(:not([has-banner])) .banner { display: none; } /* ------------------------------------------------------------- side nav */ .side-nav { grid-area: side-nav; display: flex; min-width: 0; overflow: hidden; } :host(:not([has-side-nav])) .side-nav { display: none; } /* A slotted sidebar fills the shell-owned track and drops its own surface and edge; set --nile-app-shell-side-nav-bg to restore one. */ /* width is deliberately not !important: the 100% lets a raw