/* The docs, wearing the standard. ================================ These pages used to hold a palette of their own — chocolate hues written out twice, once for dark and once for light, switched by Starlight's theme toggle. Both are gone. Starlight is built on a set of its own variables (--sl-color-*), so making it wear a theme is a matter of pointing those at the standard's intents. That's exactly the job any app adopting this standard has to do, and it's worth knowing it took the block below and nothing else: no fork, no component rewrites, thirty-odd lines against a documentation framework nobody wrote with this standard in mind. Where the variables come from: - The block on :root is this site's own base, and the *only* colors written out here. It exists because sits above the marker (Starlight renders its own , and we can't put an attribute on it — see PageFrame.astro), so something has to paint the ground underneath. It's the same chocolate as our theme record; you see it in overscroll and nowhere else. - The block on [data-mode] is the real one. It's *inside* the marker, so `var(--color-…)` resolves there, and it re-points every Starlight variable at a value the theme sets — ours by default, yours the moment you sign in. And the toggle is gone (see ThemeSelect.astro): "dark" isn't a setting inside this app, it's a theme somebody saved. */ :root { --sl-color-accent-low: #3d2a0f; --sl-color-accent: #965e01; --sl-color-accent-high: #ffe6be; --sl-color-white: #f6f0e4; --sl-color-gray-1: #eeeeee; --sl-color-gray-2: #d9cfbc; --sl-color-gray-3: #b0a186; --sl-color-gray-4: #7c6b4d; --sl-color-gray-5: #55462b; --sl-color-gray-6: #382a11; --sl-color-black: #261a08; } /* The one thing on a docs page that a visitor's theme can't reach. Starlight renders the skip link in , *before* the frame the marker is on, so it sits outside every mode: `var(--color-…)` resolves to nothing there. It was falling through to the browser's own link blue — which is why it's stated here, against the static base above, rather than left to chance. Cream on chocolate, always legible, hidden until it's tabbed to. The honest framing: this is the cost of not owning on these pages. It's one accessibility affordance rather than any content, and it is the complete list. */ .sl-skip-link { color: var(--sl-color-gray-1); background-color: var(--sl-color-black); } /* Starlight's vocabulary, in the standard's terms. Starlight's greys look like a ramp, and an earlier version of this file treated them as one — interpolating between the surface's foreground and background with color-mix to fill the middle. That was wrong twice over. It invented colors no theme had set, and it put several different foregrounds on one background: a theme names *one* ink for a given ground, and every piece of text on that ground is entitled to that ink and no other. They aren't a ramp. They're three jobs wearing one naming scheme, and grepping Starlight for what actually consumes each one sorts them out: 1–4 are text, 5–6 are rules and hairlines, 7 is a ground. Sorted that way each maps onto exactly one intent, no mixing required — which is the tell that the standard's vocabulary was the right shape and the ramp was the wrong question. (Two of these do double duty in Starlight — grey 6 borders some things and backs others. The specific consumers that back things are named explicitly below, so the general mapping can follow the majority use without ambiguity.) */ [data-mode] { /* Type. Starlight has one font slot (--sl-font) for everything body text sets font-family from, so it takes the standard's secondary family — the one ui.css already puts on body/p/li elsewhere on this site. Monospace stays put; code blocks are the standard's one deliberate exception (below), and pairing a proportional face there was never the goal. */ --sl-font: var(--typography-text-secondary-family); --sl-font-mono: ui-monospace, monospace; /* Ink. One ground, one foreground, for every piece of text on it. */ --sl-color-text: var(--color-surface-auxiliary-foreground); --sl-color-white: var(--color-surface-auxiliary-foreground); --sl-color-gray-1: var(--color-surface-auxiliary-foreground); --sl-color-gray-2: var(--color-surface-auxiliary-foreground); --sl-color-gray-3: var(--color-surface-auxiliary-foreground); --sl-color-gray-4: var(--color-surface-auxiliary-foreground); /* Links and the current heading, which are text on that same ground, so: the same ink. They're told apart by the underline and by weight, below. */ --sl-color-text-accent: var(--color-surface-auxiliary-foreground); /* Rules and hairlines. */ --sl-color-gray-5: var(--color-surface-auxiliary-border); --sl-color-gray-6: var(--color-surface-auxiliary-border); --sl-color-hairline: var(--color-surface-auxiliary-border); --sl-color-hairline-light: var(--color-surface-auxiliary-border); --sl-color-hairline-shade: var(--color-surface-auxiliary-border); /* Grounds. The nav and the sidebar are the page, not raised off it — the same call the studio's panels make. */ --sl-color-black: var(--color-surface-auxiliary-background); --sl-color-gray-7: var(--color-surface-auxiliary-background); --sl-color-bg: var(--color-surface-auxiliary-background); --sl-color-bg-nav: var(--color-surface-auxiliary-background); --sl-color-bg-sidebar: var(--color-surface-auxiliary-background); /* A thing you type into, and a thing you'd type — the intent named for exactly that. */ --sl-color-bg-inline-code: var(--color-control-background); /* The search dialog and the mobile menu genuinely float above the page, which is what the secondary surface is for. It's the docs' equivalent of the studio's (?) explanations. */ --sl-color-bg-overlay: var(--color-surface-secondary-background); /* The accent is a *fill*, never ink. It shows up in exactly one place — the filled pill marking the page you're on — and there it carries the theme's own action foreground on top of it, which is the pairing the theme actually described. */ --sl-color-accent: var(--color-action-primary-background); --sl-color-accent-high: var(--color-action-primary-background); --sl-color-accent-low: var(--color-action-primary-background); --sl-color-bg-accent: var(--color-action-primary-background); --sl-color-text-invert: var(--color-action-primary-foreground); } /* Headings get the primary family — Young Serif, same as h1/h2/h3 everywhere else on this site (ui.css). --sl-font can only hold one face, and body text needs it more (it's nearly all of what's on a docs page), so headings are called out here rather than folded into that variable. The site title in the header is set the same way: it's standing in for the wordmark, the same job a heading does. */ [data-mode] :is(h1, h2, h3, h4, h5, h6), [data-mode] .site-title { font-family: var(--typography-text-primary-family); font-weight: var(--typography-text-primary-weight); font-size: var(--typography-text-primary-size); line-height: var(--typography-text-primary-line-height); } /* Inline code sits on the control's background, so it takes the control's foreground — the one place in the docs where text legitimately isn't the surface's ink, because it isn't on the surface. */ [data-mode] .sl-markdown-content code { color: var(--color-control-foreground); } /* A card gets a ground of its own. Starlight draws its link cards as a border and a shadow on whatever is behind them, which was fine while everything on a docs page was one look. Each card is now marked `entity` (components/docs/LinkCard.astro), and a look that names a background can't show through an element that never paints one — so the card paints itself, with the same surface every other card on this site uses. */ [data-mode] .sl-link-card { background: var(--sl-color-bg); } /* A keycap is a small thing you press, which is as close to a control as the docs get. It was landing on grey 6 — a value that is a *border* here — so it had a ground made out of a line color, with page ink on top of it. Both halves of the pair, from one intent. */ [data-mode] kbd { background-color: var(--color-control-background); color: var(--color-control-foreground); border-color: var(--color-control-border); } /* Search. Pagefind's variables are already wired to Starlight's, so most of it follows from the block above; these are the two that don't. Its result tags were backed with a border color for the same reason the keycaps were, and its own stylesheet sets some text white outright, which is a color no theme here chose. */ [data-mode] #starlight__search { --pagefind-ui-tag: var(--color-control-background); } [data-mode] .dialog-frame, [data-mode] .dialog-frame p { color: inherit; } /* The page you're on: a filled pill, so it's an action's background with that action's own foreground on it. Starlight already reaches for this pair; it just names it differently. */ [data-mode] [aria-current='page'] { background-color: var(--color-action-primary-background); color: var(--color-action-primary-foreground); } /* The heading you're at, in the contents. Weight, because there is no second ink. */ [data-mode] .right-sidebar a[aria-current='true'] { font-weight: bolder; } /* ——— The one deliberate exception: code blocks ——— Everything else on this site puts one ink on one ground, because that's the pairing a theme actually describes. Code blocks don't, and it's on purpose. Syntax highlighting is color carrying *information* — which token is a string, which is a comment — and the standard has no vocabulary for that. It has intents for what a thing is *for* in an interface, not for the parts of a grammar. So there is nothing here to map onto, and a mapping would have to invent seven values no theme ever set. This is the same category as the shadow under the pretend apps' modal and the colors inside the mosaic SVG: a place where the honest answer is that the standard doesn't reach, rather than one where we pretend it does. What that costs, stated plainly: Expressive Code resolves its palette at build time, so a code block keeps its own ground *and* its own ink no matter whose theme is on. Under a light theme the page turns and the code blocks stay dark — a self-contained island rather than part of the page. That's the coherent version of the exception: freezing the ground and the ink together keeps a block readable, where theming only the ground would leave pale tokens on a pale page. An island, deliberately, and the only one. Nothing below styles them. This comment is the decision. */ /* Asides — the only Starlight component these docs use, and one that ships three separate foregrounds (white body, blue-high title, blue-high links) on a blue background, none of them the theme's. It's a block resting on the page, so it's the page: same ground, same ink, and the rule down its inline edge is what marks it out. The title is already set in a heavier face by Starlight, which is distinction enough. */ [data-mode] .starlight-aside { background-color: var(--color-surface-auxiliary-background); color: var(--color-surface-auxiliary-foreground); --sl-color-asides-border: var(--color-surface-auxiliary-border); --sl-color-asides-text-accent: var(--color-surface-auxiliary-foreground); } /* This used to be painted in the heading color, which the standard deliberately doesn't have — text takes its color from the surface it sits on. Weight is what makes it strong now, which is what the element meant in the first place. */ .sl-markdown-content strong { color: inherit; font-weight: bolder; } /* The mosaic behind a docs page's title panel used to be written here, selecting that panel with `:has(> .sl-container > h1)`. It moved to components/ContentPanel.astro, which marks that same panel `hero` — and once it's marked, the band has to be painted from the *hero* theme's values rather than from whatever the page's are, which is a thing the component can say and this file can't. The rule went with the marker so the two can't drift. */ /* The main domain's geometric mosaic backs the splash page's hero. */ [data-has-hero] .page { background: linear-gradient( color-mix(in srgb, var(--sl-color-black) 82%, transparent), var(--sl-color-black) min(48rem, 90vh) ), url('/colored-geometric.svg') center top / 400px repeat var(--sl-color-black); } [data-has-hero] header { border-color: transparent; background-color: color-mix(in srgb, var(--sl-color-black) 70%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); } .right-sidebar-panel { height: 100%; } .right-sidebar-panel .sl-container { height: inherit; display: flex; flex-direction: column; } .right-sidebar dsh-footer { margin-block-start: auto; font-size: .8em; }