WIP - style: flatten light-theme surfaces and unify elevation - #35
Draft
a-effort wants to merge 9 commits into
Draft
WIP - style: flatten light-theme surfaces and unify elevation#35a-effort wants to merge 9 commits into
a-effort wants to merge 9 commits into
Conversation
The light theme is flat by design: surfaces get no elevation, and
controls carry none in either theme. Tailwind inlines shadow values at
build time — only the color is a variable, and --tw-shadow-color is
registered inherits: false — so there is no single place to switch them
off per theme. Add elevation-xs, elevation-sm and elevation-panel
utilities that read a variable instead: flat in light, the values the
raw Tailwind utilities used in dark, so nothing shifts there.
Three rules now hold:
controls no shadow in either theme. Buttons, inputs, switches, and
select triggers are flat; segmented controls that used
shadow-sm as their only selected-state signal get
ring-1 ring-border, which reads in both themes.
surfaces elevation-*. Cards, form panels, toolbars, icon chips.
floating untouched. Popovers, dropdowns, dialogs, sheets and the
slide-over detail panels overlay the page and need the
separation in both themes.
The utilities compose through --tw-shadow rather than setting box-shadow
directly, because ring-* builds its outline from the same box-shadow
list; setting the property outright made elevation-* win on cascade
order and erased the ring on every card in light mode.
Also replaces the two sidebar menu outlines drawn as
shadow-[0_0_0_1px_hsl(var(--sidebar-border))] with ring utilities. Those
resolved to hsl(oklch(...)) after the oklch token migration, which is
invalid, so the outline they intended has not been rendering.
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
…-server card Signed-off-by: Anna Effort <anna.effort@ibm.com>
…aceholders Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Signed-off-by: Anna Effort <anna.effort@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #34. Light theme is flat by design: surfaces get no elevation, controls carry none in either theme, and floating layers keep theirs.
Why a token
Tailwind inlines shadow values at build time — only the color is a variable, and
--tw-shadow-coloris registeredinherits: false— so there is no single place to switch shadows off per theme.src/index.cssgains four utilities that read a variable instead:elevation-xsshadow-xselevation-smshadow-smelevation-panelelevation-controlDark mode keeps the exact values the raw utilities used, so nothing shifts there.
They compose through
--tw-shadowrather than settingbox-shadowdirectly. This matters:ring-*builds its outline from the samebox-shadowlist, and.elevation-*is emitted after.ring-1, so setting the property outright erased the ring on every card in light mode.Three rules
elevation-*: cards, form panels, toolbars, icon chips.elevation-controlis the deliberate exception. Flattening the selected chip of a segmented control loses what makes it read as selected, so it stays raised in both themes. All 13 segmented controls in the app now share it — previously they split across two shadow levels and a dark-fill variant.Also here
bg-white text-blacksubmit button that was invisible against the light card, and dropped five one-off hex literals (#141414,#2b2b2f,#55555c,#252529,#343438).neutral-400/neutral-500totext-muted-foreground— more legible in both themes. ~12 overrides remain in the tools/resources/prompts forms; see the note below.variant="ghost"carriesaria-expanded:bg-muted, so Optional configuration and Advanced settings filled whenever expanded.tool-add-icontokens like its siblings, instead of a hardcoded gray.shadow-[0_0_0_1px_hsl(var(--sidebar-border))]resolves tohsl(oklch(...))after the token migration, which is invalid — that outline has not been rendering. Replaced withring-*.Testing
2841 unit tests pass;
tsc --noEmit,eslint, andprettier --checkclean. One test needed updating:input.test.tsxasserted the input carriesshadow-xs.The utilities were verified against the emitted CSS — light resolves to
0 0 #0000, dark to the original Tailwind values byte-for-byte, and all four variant forms (aria-pressed:,peer-checked:,data-[state=active]:,data-[state=checked]:) compile.This is a visual change and the tests do not cover it. Both regressions caught during development — the ring clobbering above, and a card that went white in dark mode — were found by eye, not by CI. Worth a pass through both themes before merge.
Not included
--card(which currently equals--mainexactly, sobg-cardgives no separation from the page). Parked onform-card-fill; needs rework.ui/inputandui/textareadisagree on placeholder colour — the token vs. hardcoded neutrals, running opposite to each other. ~12 per-form overrides work around it. Fixing it intextarea.tsxis one line but touches every textarea.shadow-noneoverrides, left over from cancelling shadows the primitives no longer have.