Repository navigation
Studio: make the contrast slider reach surfaces and controls - #11459
Conversation
The contrast slider only remapped --border, --sidebar-border and muted text, so cards, menus, buttons and control fills ignored it and the setting looked like it did nothing. The palettes now author their surfaces and lines as --*-base and two rules own the public tokens: an identity at :root, and a html[data-contrast-adjust] block that mixes each toward the foreground above 50 or the background below it. Fills, hairlines, control outlines and secondary text each get their own curve. Controls that wash the page with translucent white or black instead of taking a token now carry their authored alpha times a gain, so they move in step. Opaque scrims keep their own alpha.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Drop the description line and match the run settings controls: the value moves into a panel field beside the label, and the track becomes a full-width panel-slider under the row, step 1 so it drags smoothly. SettingsRow gains a `below` slot for full-width content on its own line.
|
Pushed a follow-up to the row itself:
The now-unused |
The resting fill was derived while its hover twin kept its authored value, so at high contrast the two crossed: in light mode the resting surface went darker than the fixed hover, and the hover read lighter. Derive both from the same curve.
|
Correct, and it was visible on every settings dropdown. Fixed in Measured the pair as sRGB over the page colour, at 0 / 50 / 100, hover minus resting in relative luminance:
So hover stays darker than resting in light and lighter in dark at every setting, and both collapse toward the page at 0. Before the fix the light 100 case was resting 226 against a fixed hover of 239, a +13 inversion. One related case I looked at and left alone: |
|
@codex review |
Conflict in projects-page.tsx only: #11443 restructured the row, so take its version and re-apply the wash conversion to it. Its new row assertion moves to the converted class.
The full-width track under the row read as a section, not a row. Put the run settings slider and its field back on the row itself, beside the label, so the contrast row lines up with the controls above it.
Three controls sat outside the slider's reach. .panel-slider repaints the track, fill and thumb with !important, so the parameter sliders in chat, model config, RAG, Images and Video never moved; the track alpha now takes the wash gain and --panel-slider-fg follows the text curve. The profile picture button and the dictation stop button scaled only their resting fill, so above about 80 the hover read fainter than the resting state. Both hover alphas now take the same gain.
The dataset dropzone scaled only its resting border, so hovering or dragging jumped to a fixed 30% or 40% outline: at contrast 0 that is an eightfold step out of the setting, and at 100 the hover lands on top of the resting state. The dark colour swatch ring was fixed the same way while its light twin already scaled.
|
Fixed the four remaining findings. All of them were the same shape: a resting value on the curve next to a fixed twin.
While checking those I swept the rest of the gain-aware files. The only other split pair was the colour swatch ring, where the light branch scaled and the dark one did not, so that is on the gain too. The overlays that cover content (the settings backdrop, the image hover scrim, the selection marker) keep their own alpha on purpose, they are not chrome. |
|
@codex review |
bg-foreground/[x] is a fixed alpha, so rows, chips and progress tracks that dimmed or lifted in dark mode sat still in light mode. Each one is now mixed from the same token with the gain applied, which resolves to the identical colour at the default and moves with the slider elsewhere.
|
Right about the catalog rows, and it was not only those rows. All of them now mix from the same token with the gain applied: Measured against the class it replaces, that resolves to Also merged main, which came in clean here. |
|
@codex review |
bg-foreground/5 and /10 are the same fixed alpha in shorthand, so the Studio progress track, the export badges, the attachment tile and the chat action button still ignored the setting. The sweep now catches both spellings. Two fills stay fixed: the dark button's own surface, and the snippet highlight whose amber and red siblings are on no curve.
|
Right, the sweep only matched the arbitrary spelling. Extended it to the shorthand and migrated the five it found: the Studio progress track, the export badge and icon circle, the attachment tile and the chat action button's hover. Two are deliberately left fixed, and the test names them:
|
|
@codex review |
The dropzone's own borders were the last fixed part of it: resting 15%, hover 30%, drag-over 45%, while its fills and its dark borders followed the slider. Every light border-foreground hairline now mixes with the edge gain, so a control's outline moves with the setting the way its fill already does.
|
Confirmed the slider previously only moved --border, --sidebar-border and muted text, so cards, menus and control fills ignored it, and that the derived tokens resolve to the authored literals at the default. Will get this reviewed. |
Five dark fills were written as literal hex and sat on top of gain-aware rules: the model card hover, the soft field's focus, the instant menu, the hero panel, and the light tab pill's hover. At contrast 100 the card hover dimmed a card that had just brightened, and the focused field lost its distance from rest. Each one is now the same colour at the default, written as the wash its twin uses, or as a surface mix where the tint has to survive.
|
Both right, and there were five of these rather than two: the model card hover, the soft field's focus, the instant menu surface, the hero panel, and the light tab pill's hover were all literal hex sitting on top of gain-aware rules. Each is now written as the wash its twin already uses, over the page colour so the painted result stays opaque, with the percentage chosen to land on the shipped colour. Measured in the dark palette:
Worth noting the dark hover and focus have always been a shade darker than their resting state, not lighter. That is the shipped look and I kept it; the point of the change is that the pair now moves together instead of one of them standing still. The instant menu keeps its blue tint, so it takes the surface mix rather than a neutral wash, and is byte-identical at the default. |
|
@codex review |
The bar's dark surface was a fixed #2c2c2c while --card moves with the slider, so at contrast 100 the cards passed it and the bar read as a groove in the page it floats over. It takes the same surface step now, which holds card below bar below border at 0, 50 and 100, and the test reads both sides rather than one.
|
Right. The bar sat at a fixed
Card below bar below border at all three, which is the ordering The light bar is still the composer's white, deliberately: that test pins the two to the same colour and the composer is fixed white as well, so the pair stays consistent. |
|
@codex review |
|
You were right that a class sweep misses washes written longhand in CSS. Three of them were still fixed:
All three now carry calc(N * var(--contrast-wash-gain, 1)). Computed values: identical at the default (0.06, 0.1, 0.12), 0.102 / 0.17 / 0.204 at the top of the range, 0.015 / 0.025 / 0.03 at the bottom. tests/contrast-slider.test.ts gained a RAW_WASH pattern next to the class sweep, so a longhand rgba background with a fractional alpha is caught the same way. Verified it bites by restoring the old rgba line, which made the test report index.css. Box shadows keep their own alphas. Those are depth rather than chrome, and the find bar tests pin them. @codex review |
|
Correct, the arbitrary value is a spelling neither pattern saw: colour and alpha both sit inside the brackets. Those three chips in model-inspector.tsx are the only ones in the tree, and they pair with bg-muted in light mode, which does follow the curve, so the dark twin was the odd one out. All three are now dark:bg-[rgb(255_255_255_/_calc(0.04*var(--contrast-wash-gain,1)))]. Computed in the browser: rgba(255, 255, 255, 0.04) at the default, 0.067 at the top of the range, 0.01 at the bottom. FIXED_WASH grew a fourth alternative for bg-[rgba(...)] and bg-[rgb(... / .04)]. Verified it bites by putting the old class back, which made the test report model-inspector.tsx. @codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Resolves against the contrast slider work in #11459 and the UI spacing scale in #11458. The slider moved surfaces, hovers and lines onto --*-base tokens that a contrast mix derives from, so the new dark values are authored as -base and the slider reaches all of them. The washes on hub.css controls and the picker chips keep upstream's calc(N% * var(--contrast-wash-gain)) form with our percentages. Took upstream's version for the Hub card hover and hero panel: both were hardcoded before, and making them contrast aware solves that better than pointing them at a token, which is all our side did there. Kept ours for the model picker tier consolidation, the composer pills and the settings dialog close button, with upstream's --ui-space-scale sizing and wash syntax folded in.
…ai#11459) * Studio: make the contrast slider reach surfaces and controls The contrast slider only remapped --border, --sidebar-border and muted text, so cards, menus, buttons and control fills ignored it and the setting looked like it did nothing. The palettes now author their surfaces and lines as --*-base and two rules own the public tokens: an identity at :root, and a html[data-contrast-adjust] block that mixes each toward the foreground above 50 or the background below it. Fills, hairlines, control outlines and secondary text each get their own curve. Controls that wash the page with translucent white or black instead of taking a token now carry their authored alpha times a gain, so they move in step. Opaque scrims keep their own alpha. * Studio: contrast row uses the run settings slider Drop the description line and match the run settings controls: the value moves into a panel field beside the label, and the track becomes a full-width panel-slider under the row, step 1 so it drags smoothly. SettingsRow gains a `below` slot for full-width content on its own line. * Studio: keep the panel input hover on the contrast curve The resting fill was derived while its hover twin kept its authored value, so at high contrast the two crossed: in light mode the resting surface went darker than the fixed hover, and the hover read lighter. Derive both from the same curve. * Studio: keep the contrast slider in the settings control column The full-width track under the row read as a section, not a row. Put the run settings slider and its field back on the row itself, beside the label, so the contrast row lines up with the controls above it. * Studio: contrast reaches panel sliders and hover washes Three controls sat outside the slider's reach. .panel-slider repaints the track, fill and thumb with !important, so the parameter sliders in chat, model config, RAG, Images and Video never moved; the track alpha now takes the wash gain and --panel-slider-fg follows the text curve. The profile picture button and the dictation stop button scaled only their resting fill, so above about 80 the hover read fainter than the resting state. Both hover alphas now take the same gain. * Studio: put the dropzone and swatch outlines on the edge gain The dataset dropzone scaled only its resting border, so hovering or dragging jumped to a fixed 30% or 40% outline: at contrast 0 that is an eightfold step out of the setting, and at 100 the hover lands on top of the resting state. The dark colour swatch ring was fixed the same way while its light twin already scaled. * Studio: put the light-theme washes on the contrast gain bg-foreground/[x] is a fixed alpha, so rows, chips and progress tracks that dimmed or lifted in dark mode sat still in light mode. Each one is now mixed from the same token with the gain applied, which resolves to the identical colour at the default and moves with the slider elsewhere. * Studio: put the shorthand foreground washes on the gain too bg-foreground/5 and /10 are the same fixed alpha in shorthand, so the Studio progress track, the export badges, the attachment tile and the chat action button still ignored the setting. The sweep now catches both spellings. Two fills stay fixed: the dark button's own surface, and the snippet highlight whose amber and red siblings are on no curve. * Studio: put the light-theme outlines on the edge gain The dropzone's own borders were the last fixed part of it: resting 15%, hover 30%, drag-over 45%, while its fills and its dark borders followed the slider. Every light border-foreground hairline now mixes with the edge gain, so a control's outline moves with the setting the way its fill already does. * Studio: route the last hover surfaces through the contrast tokens --sidebar-accent, --chat-icon-bg-hover and the line tab's indicator were authored straight by the palettes, so the chat controls, the model picker rows and the selected tab kept their shipped contrast at 0 and at 100. All three are now authored as -base and derived on the surface curve. The picker rows and the project switcher also hardcoded the light value those tokens already carry, so they take the token instead. * Studio: shorten three appearance descriptions Chat width, Sidebar navigation and Profile menu each explained what the list below already shows. The fixed rows read as fixed on screen, so the sentences about them are gone, in all twelve locales. * Studio: reach the washes the stylesheets author The sweep only read .tsx, so anything authored in CSS or in a .ts helper escaped it: the panel number input's hover and focus fills, the composer and thinking pills' dark hover, the Hub's tag and card surfaces, and the LoRA option's light hover outline. The scan now covers .ts and .css, minus the scrims, and the Hub sheet's foreground mixes carry the wash or edge gain by property. Every one resolves to its authored value at the default. * Studio: sweep the numeric black and white washes too The scan read an arbitrary alpha on black and white but only shorthand on the foreground token, so bg-white/25 and its kind passed unseen. It now reads all four spellings, and the surfaces that stay fixed are named rather than missed: the media viewers and their controls, the image hover scrims and the selection markers, which stage a picture at a contrast of their own. * Studio: put the ring hairlines on the edge gain too Cards, dialogs, menus and hover cards draw their outline as a ring rather than a border, so the sweep never saw them: at contrast 0 the surfaces flattened into the page while their outlines held full strength. All eleven now mix with the edge gain, and the scan reads both spellings. Focus rings are untouched, they take --ring. * Studio: put the Hub's fixed hex fills on the curve Five dark fills were written as literal hex and sat on top of gain-aware rules: the model card hover, the soft field's focus, the instant menu, the hero panel, and the light tab pill's hover. At contrast 100 the card hover dimmed a card that had just brightened, and the focused field lost its distance from rest. Each one is now the same colour at the default, written as the wash its twin uses, or as a surface mix where the tint has to survive. * Studio: keep the find bar above the cards at any contrast The bar's dark surface was a fixed #2c2c2c while --card moves with the slider, so at contrast 100 the cards passed it and the bar read as a groove in the page it floats over. It takes the same surface step now, which holds card below bar below border at 0, 50 and 100, and the test reads both sides rather than one. * Studio: put the longhand menu washes on the contrast gain * Studio: put the inspector's arbitrary rgba chips on the contrast gain --------- Co-authored-by: shimmyshimmer <[email protected]>
…tten against (unslothai#11505) * Read the scaled lengths and colours the UI contracts were written against Repo tests (CPU, studio) is red on main: 12 tests across test_desktop_reliability_frontend_contract.py and test_update_release_notes.py. Bisected to two UI PRs that each merged with this lane already failing: 42fc28f (before both) 228 passed, 0 failed 3bc5eb5 (unslothai#11459) 2 failed 10c380e (unslothai#11458) 12 failed Both PRs are right, and neither changes what renders. unslothai#11458 made spacing follow the UI font size by wrapping fixed lengths as calc(X * var(--ui-space-scale, 1)), where the scale is calc(--ui-font-scale / 0.9375) and --ui-font-scale defaults to 0.9375, so the scale is 1 and every length is what it was. unslothai#11459 did the same for colour, respelling foreground/10 as a color-mix scaled by --contrast-edge-gain and white/[0.06] as an rgb() scaled by --contrast-wash-gain, both defaulting to 1. So only the spelling moved, and these contracts are written against the values. They now read through _at_default_scale, which resolves calc(X * var(--s, 1)) to X, a color-mix of a token at N% with transparent to token/N, and an rgb() white at alpha A to white/[A]. Those are the same values written out, so a contract keeps asking what it asked before. Two assertions needed more than the reader. The titlebar slot became max(7rem, calc(7rem * var(--ui-space-scale, 1))), a floor so it never shrinks under the three 30px buttons, and prettier wrapped the ternary over three lines, so that one matches across whitespace and against the 7rem rather than one exact expression. The notes surface reads the white and the 0.06 rather than the shorthand. Worth recording for the sidebar guard: unslothai#11458 scaled the pin's own offset and padding as well as --spacing, so both sides of that geometry scale together and the arithmetic in spacing units stays exact at every scale, not just the default. Verified: 228 passed across the two files, which is what main had before unslothai#11459. Sabotage checks through the new spellings, so the reader cannot be hiding a real change: moving the pin's right offset from 1.875rem to 3.5rem fails the coarse-pointer guard, and moving the image footer border from 10% to 40% fails the image page contract. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Close the two holes in the new readers Both matches stopped short of what they claimed. The alpha regex ended at --contrast-wash-gain, so a misspelled variable such as --contrast-wash-gain-broken, or trailing arithmetic like +0.5, satisfied an assertion about a 0.06 white lift that no longer renders. It now matches through the fallback and both closing brackets. The titlebar match looked for 7rem as an unbounded substring, so 17rem and 0.7rem passed a contract about a 7rem floor. The numeric token now has boundaries on both sides. Verified: 228 passed still, and each case the review named now fails where it passed before - 17rem fails the titlebar contract, --contrast-wash-gain-broken fails the notes surface. * Read the clipboard payload at the default scale too The one frontend source in this file still read raw. It passes either way today, but a scaled length landing in it would be invisible to the contract for the same reason every other read goes through _ui_source. * Pin both terms of the titlebar max, not one 7rem anywhere in it Boundaries on the number were still not enough. The regex only needed one standalone 7rem somewhere in the value, so max(7rem, calc(17rem * var(--ui-space-scale, 1))) normalises to max(7rem, 17rem), satisfies the match on its first term, and renders a 17rem slot while the contract says 7rem. The whole value is pinned now: either a bare 7rem or a max of 7rem with itself, and nothing else. Verified both ways round, since one term passing is exactly what went wrong: 17rem in the scaled operand fails, and 17rem in the floor fails. 37 passed. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Normalize only the four scales, over the values they are defined for Reading `var(--anything, 1)` collapsed a length hung off an unrelated property, or off a typo like `--ui-spcae-scale`, back to the literal the contract asks about, so a pane that had stopped following the interface font size still satisfied its guard. Lengths now resolve only through --ui-space-scale / --ui-font-scale and colour amounts only through --contrast-wash-gain / --contrast-edge-gain. * Read the spacing scale only, and each gain only for its own role --ui-font-scale is 0.9375, not 1, so a length respelled onto it renders smaller than the literal a contract asks about; only --ui-space-scale, derived as the ratio of the two, is identity by default. The contrast gains are identity at rest but not interchangeable: the appearance store gives the edge and the wash different spans, so a border scaled by the wash renders a colour its contract does not name off default. Surfaces now resolve under the wash, borders and rings under the edge. The release notes lift also has to end where the class ends: a trailing -broken names no utility and a /50 is a different lift, and a match that stopped at the closing bracket accepted both. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Read window chrome raw, and end the notes class at a real boundary The custom titlebar is 34px because the Tauri decoration is 34px, and nothing about the interface font size moves it. Reading that mirror through the scale normaliser accepted a scaled spelling as 34px while the real titlebar stayed put and the portalled sheets slid off it, so the chrome is now read exactly as written. The notes lift excluded selected suffix characters rather than requiring the class to end: a colon still passed, and Tailwind reads the whole colon-delimited string as a different candidate. It now has to end at whitespace, a quote or the end of the string. * Require the gain and state the scaling the geometry contracts assume A colour that keeps its amount but drops the gain renders the same thing at the default setting and nothing like it anywhere else, so only the gain-bearing spelling is now read back as the shorthand. A bare color-mix at 10% no longer satisfies a border-foreground/10 contract. Lengths cannot be told apart the same way: a band that has gone back to a bare h-[48px] reads as 48px, which is what the geometry contracts ask for. The scaling is stated directly instead, over the header bands those contracts measure, so unwrapping one fails here rather than passing everywhere. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Anchor the notes class at both ends and pin the rest of the scaled offsets A hover: in front of the notes lift paints it only under the pointer, and the match happily started in the middle of that class. It now has to start at a class boundary as well as end at one. The scaling pin covered the header band only, so the pane offsets those same contracts measure could still be unwrapped unseen: the images and audio 60px preview insets and the training rail's 42px. The table is now keyed on the utility and the length, and every row rejects the bare spelling. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Count whole utilities, not substrings of them h is a substring of min-h, so a band respelled as min-h-[calc(48px*...)] kept the count and the normalised reads alike, while the band it names is no longer fixed and can grow past the titlebar geometry these contracts measure. Both halves of the pin now require a class-token boundary in front of the utility. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Carry each row's variant, and pin the gain the colour contracts read A colon is not a word character, so the previous boundary let hover:h-[calc(48px*...)] answer for the fixed band, and a height that applies only under the pointer is not the band these contracts measure. Each row now carries its own variant and has to start where a class can start. The colour side had the same blind spot with no guard at all: a literal border-foreground/10 satisfies the contract that names it while no longer responding to the contrast setting, because that is exactly what the reader answers for the gain-scaled spelling. The gain is now stated directly, as the lengths are. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Pin the titlebar slot and the pin's own geometry to the scale The titlebar assertion accepted a bare 7rem as equal to the scaled max(), and it is not the same guarantee: the navigation buttons' padding and gaps still scale, so a fixed slot is overrun at a larger setting and the drag region starts inside the navigation. It is read raw now, with both terms pinned. index.css needed the same statement. The pin's offset and padding are compared against a Tailwind gutter that follows --spacing, so unwrapping either one drifts from the gutter at every setting but the default, while the reach arithmetic that decides whether the pin can overlap the title carries on against a number the UI no longer renders. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * End the pinned utilities at a class boundary as well as start them there A trailing :broken is not a suffix on the utility, it is a different candidate: Tailwind emits nothing for it and the band loses its fixed height, while the normalised source still shows the length this file asks about and every contract downstream stays green. Both pins now require the class to end where the match does. * Guard every platform's chat header geometry, not the first one stated The header height, its padding and the control height are written out once per platform chrome, and the contracts that do arithmetic on them read the provider normalised. A height back on a bare 44px reads as 44px, which is what the arithmetic wants, while the padding and control beside it still scale: above the default they grow and it does not, their sum passes the header, and the shared titlebar row is clipped. Checked over every declaration rather than the first match, since the existing frontend guard stops at one and so answers for one platform while reading another. * Pin the sidebar row geometry the compact-row contract measures The row height, the pinned gap and the project indent are hand-set one-off lengths, which is exactly the spacing that used to stay put while the labels grew. Normalised they read the same either way, so the compact row contract could not see one being unwrapped and the row would clip its own text at a larger setting. * Pin the 34px media controls, in all three spellings the pages use The band around these pills scales and so does their own text, so a control left fixed is the one thing in that row that does not move and it crowds out its label. The pages write the height three ways, plain, with a bang and through a button variant, and each needed its own row. * Ask each chrome for its own chat geometry, not the file as a whole The chromes are alternatives, so one of them stating a declaration says nothing about the other. Dropping all three from the custom chrome left its users on the root geometry rather than the padding and control height that row is laid out against, while the mac block's copies answered for it in a global search. The variables are now read out of each block. * Read the native chrome constants raw, and pin the chat page's round controls The mac titlebar is 34px because the OS decoration is, and the runtime divides it by the webview zoom rather than scaling it with the interface font. Read normalised, a constant respelled onto the spacing scale collapsed back to 34px and every chrome contract agreed with itself while the CSS moved off the native chrome it sits against. The chat page's 30px round controls, the collapsed New Chat button among them, sit in a header that grows with the setting, so one left fixed shrinks against its own row. Both spellings pinned. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
What
Settings > Appearance > Contrast only remapped three things:
--border,--sidebar-borderand muted text. Cards, menus, secondary buttons, hover fills and every control fill ignored it, so moving the slider looked like it did almost nothing.How
The palettes now author their surfaces and lines as
--*-base, and two rules own the tokens the app reads: an identity at:root, and ahtml[data-contrast-adjust]block that mixes each toward--contrast-target(the foreground above 50, the background below it). One place to retune every card, popover, secondary button, hover fill, input pill, hairline and control outline, in all three palettes.Four curves, because one number for all of them is wrong:
Asymmetric on purpose. A card mixed far toward the foreground reads as a block rather than a surface, while the bottom of the range should flatten. Neither floor reaches the page colour: a dropdown still has to be findable over what it covers at 0, which I checked with a menu open. Control outlines stop short of the hairlines for the same reason, otherwise an unchecked switch disappears in light mode.
About 160 controls (Settings, Hub, pickers) do not use tokens at all, they are hand-written
dark:bg-white/[0.06]andborder-white/15washes. Those now carry their authored alpha times--contrast-wash-gainor--contrast-edge-gain, so they fade and strengthen in step. Opaque scrims (bg-black/85, image hover overlays) are left alone, they cover content rather than being chrome.Also in here:
reload-snapshot.jscarries all seven variables, so a reload does not repaint at stock contrast.Checked
Dark and light, at 0, 50 and 100. At 100 the pills, segmented controls and dividers lift clearly off the page; at 0 they dissolve into it while text stays legible; at 50 the derived tokens resolve to the exact authored literals (
#212121,#303030), so the default is unchanged. Driven through the real slider andapplyCustomizationToDocument, not just the CSS.tscclean,vite buildclean, i18n parity passes, full suite passes (8194). Newcontrast-slider.test.tscovers the ownership, the identity at the default, the curves and the snapshot list. Three existing assertions were updated where they read a renamed token or a converted wash.