/* Shared web UI chrome -- the base layout, navbar, sidebar, and footer used by every ops-tool dashboard built on this module (yasta, yasl, yaiam, yakwui, yamase-web, yamocir). Loaded after bootstrap.min.css. Page-content styling (cards, tables, badges, forms, ...) is each project's own concern and lives in that project's own stylesheet, loaded alongside this one -- see PageHeader.ExtraHeadHTML. The palette is exposed as --yw-* custom properties, not baked into each rule -- a documented, reusable theme, not an implementation detail. Three values for PageHeader.Theme (see layout.go), rendered as : "dark", "light", and "system" (follows the browser's prefers-color-scheme). Unset Theme (every consumer that never sets it) resolves to the bare :root block, i.e. dark -- today's exact look. A consumer's own stylesheet that needs theme-dependent colors mirrors the same selector structure for its own custom properties instead of redefining these -- see README.md's Theming section. */ /* Dark: the default (bare :root), explicit "dark", and "system" unless the media query below switches it to light. */ :root, :root[data-theme="dark"], :root[data-theme="system"] { color-scheme: dark; --yw-bg: #1a1d23; --yw-text: #d4d8e0; --yw-border: #333; --yw-chrome-bg: #14171e; --yw-chrome-border: #272d3a; --yw-accent: #4fc3f7; --yw-accent-rgb: 79, 195, 247; --yw-nav-link: #0b82b8; --yw-nav-link-hover-text: #c8d4e4; --yw-subtitle: #5a7a9a; --yw-subtitle-sep: #333c4a; --yw-footer-text: #4a5a72; --yw-success-bg: #192e22; --yw-success-border: #2a5c3a; --yw-success-text: #7ecf98; --yw-danger-bg: #2e1820; --yw-danger-border: #5c2a32; --yw-danger-text: #e08090; --bs-body-bg: var(--yw-bg); --bs-body-color: var(--yw-text); --bs-border-color: var(--yw-border); } /* Light: explicit "light", and "system" on a light-preferring browser. The two blocks are kept identical by hand -- CSS can't share one declaration block between a plain rule and a media query. --yw-nav-link stays #0b82b8 (a cross-project design token, see the meta-repo AGENTS.md); it reads fine on both backgrounds. */ :root[data-theme="light"] { color-scheme: light; --yw-bg: #f4f6f9; --yw-text: #1f2530; --yw-border: #d3d9e2; --yw-chrome-bg: #ffffff; --yw-chrome-border: #dde2ea; --yw-accent: #0a72a3; --yw-accent-rgb: 10, 114, 163; --yw-nav-link: #0b82b8; --yw-nav-link-hover-text: #0a4f72; --yw-subtitle: #5a7088; --yw-subtitle-sep: #c3cad5; --yw-footer-text: #6a7a90; --yw-success-bg: #e5f4ea; --yw-success-border: #a6d4b4; --yw-success-text: #1c5e33; --yw-danger-bg: #fbe9ec; --yw-danger-border: #e6b0b8; --yw-danger-text: #9b2335; --bs-body-bg: var(--yw-bg); --bs-body-color: var(--yw-text); --bs-border-color: var(--yw-border); } @media (prefers-color-scheme: light) { :root[data-theme="system"] { color-scheme: light; --yw-bg: #f4f6f9; --yw-text: #1f2530; --yw-border: #d3d9e2; --yw-chrome-bg: #ffffff; --yw-chrome-border: #dde2ea; --yw-accent: #0a72a3; --yw-accent-rgb: 10, 114, 163; --yw-nav-link: #0b82b8; --yw-nav-link-hover-text: #0a4f72; --yw-subtitle: #5a7088; --yw-subtitle-sep: #c3cad5; --yw-footer-text: #6a7a90; --yw-success-bg: #e5f4ea; --yw-success-border: #a6d4b4; --yw-success-text: #1c5e33; --yw-danger-bg: #fbe9ec; --yw-danger-border: #e6b0b8; --yw-danger-text: #9b2335; --bs-body-bg: var(--yw-bg); --bs-body-color: var(--yw-text); --bs-border-color: var(--yw-border); } } html { height: 100%; } /* Flex column so the footer sits right after the content when the page is short, and grows naturally when content is long. */ body { background: var(--yw-bg); color: var(--yw-text); font-size: 0.875rem; min-height: 100%; display: flex; flex-direction: column; } /* bootstrap.min.css's own ".container-fluid" rule sets "display: flex; align-items: center; justify-content: space-between" (meant for a navbar's inner container-fluid, but the selector isn't scoped to .navbar, so it also matches the page's own top-level .container-fluid below). Scoped to "body > .container-fluid" -- NOT a bare ".container-fluid" -- so this doesn't also hijack the navbar's own inner .container-fluid. */ body > .container-fluid { flex: 1 0 auto; display: flex; flex-direction: column; align-items: stretch; } /* .row's own height must come from flex-grow, not a percentage min-height: without this the sidebar's dark background only extends as far as its own nav links on short pages instead of the full available height. */ body > .container-fluid > .row { flex: 1 0 auto; } /* --- Navbar ------------------------------------------------ */ .navbar { background: var(--yw-chrome-bg) !important; border-bottom: 1px solid var(--yw-chrome-border); padding: .6rem 1.2rem; } .navbar-brand { color: var(--yw-accent) !important; letter-spacing: 2.5px; font-size: 1rem; } .navbar-subtitle { color: var(--yw-subtitle); font-size: .82rem; text-decoration: none; } a.navbar-subtitle:hover { color: var(--yw-accent); } .navbar-subtitle-sep { color: var(--yw-subtitle-sep); margin: 0 .5rem; } /* --- Sidebar ------------------------------------------------ */ .sidebar { background: var(--yw-chrome-bg); border-right: 1px solid var(--yw-chrome-border); padding-top: .5rem; } .sidebar .nav-link { color: var(--yw-nav-link); font-size: .85rem; padding: .5rem 1rem; border-radius: 0; } .sidebar .nav-link:hover { background: rgba(var(--yw-accent-rgb), .08); color: var(--yw-nav-link-hover-text); } .sidebar .nav-link.active { background: rgba(var(--yw-accent-rgb), .1); color: var(--yw-accent); font-weight: 600; border-left: 2px solid var(--yw-accent); } /* --- Alerts (flash banners) ---------------------------------------- */ .alert-success { background: var(--yw-success-bg); border-color: var(--yw-success-border); color: var(--yw-success-text); } .alert-danger { background: var(--yw-danger-bg); border-color: var(--yw-danger-border); color: var(--yw-danger-text); } /* --- Footer ------------------------------------------------- */ .footer { color: var(--yw-footer-text); font-size: 0.8rem; text-align: center; padding: 0.8rem 1rem; border-top: 1px solid var(--yw-chrome-border); } /* Narrow screens (below Bootstrap's md breakpoint, where the sidebar column stacks above the content): the sidebar becomes a tab bar -- the same look as a page's own Bootstrap .nav-tabs (e.g. a manual's topic tabs): one row of links that wraps onto further rows when they don't fit, never a sideways-scrolling strip, the active one underlined in the accent color. */ @media (max-width: 767.98px) { .sidebar { border-right: none; border-bottom: 1px solid var(--yw-chrome-border); padding-top: 0; } /* !important: Bootstrap's .flex-column utility is !important itself. */ .sidebar .nav.flex-column { flex-direction: row !important; flex-wrap: wrap; padding-top: 0 !important; } .sidebar .nav-link { padding: .55rem .85rem; border-bottom: 2px solid transparent; white-space: nowrap; } .sidebar .nav-link.active { border-left: none; border-bottom: 2px solid var(--yw-accent); } /* The navbar's own extras (a project's config path, action buttons) wrap onto a second line instead of widening the page past the screen. */ .navbar > .container-fluid { flex-wrap: wrap; row-gap: .4rem; } .navbar > .container-fluid > div { flex-wrap: wrap; min-width: 0; } .navbar-subtitle { overflow-wrap: anywhere; } /* The stacked row still grows to fill the page (see above); without this, the extra height is shared out between its wrapped lines and the tab bar gets an empty band below its links. */ body > .container-fluid > .row { align-content: flex-start; } }