Skip to content

WIP - style: flatten light-theme surfaces and unify elevation - #35

Draft
a-effort wants to merge 9 commits into
mainfrom
light-theme-shadow-cleanup
Draft

WIP - style: flatten light-theme surfaces and unify elevation#35
a-effort wants to merge 9 commits into
mainfrom
light-theme-shadow-cleanup

Conversation

@a-effort

Copy link
Copy Markdown
Contributor

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-color is registered inherits: false — so there is no single place to switch shadows off per theme. src/index.css gains four utilities that read a variable instead:

token light dark
elevation-xs flat Tailwind's shadow-xs
elevation-sm flat Tailwind's shadow-sm
elevation-panel flat the form-panel shadow
elevation-control raised raised

Dark mode keeps the exact values the raw utilities used, so nothing shifts there.

They compose through --tw-shadow rather than setting box-shadow directly. This matters: ring-* builds its outline from the same box-shadow list, and .elevation-* is emitted after .ring-1, so setting the property outright erased the ring on every card in light mode.

Three rules

  • controls — no shadow in either theme: buttons, inputs, switches, select triggers.
  • surfaceselevation-*: cards, form panels, toolbars, icon chips.
  • floating — untouched: popovers, dropdowns, dialogs, sheets, the five slide-over detail panels.

elevation-control is 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

  • Two forms aligned. The create-server form adopted the connect-MCP-server form's chrome: card border/padding/elevation, icon chip, heading and intro type, inputs, disclosure toggle, and footer buttons. That fixed a pre-existing bg-white text-black submit button that was invisible against the light card, and dropped five one-off hex literals (#141414, #2b2b2f, #55555c, #252529, #343438).
  • Placeholders on the token. 17 fields across the MCP server form and its auth panels moved from hardcoded neutral-400/neutral-500 to text-muted-foreground — more legible in both themes. ~12 overrides remain in the tools/resources/prompts forms; see the note below.
  • Disclosure toggles no longer fill. variant="ghost" carries aria-expanded:bg-muted, so Optional configuration and Advanced settings filled whenever expanded.
  • Add resources chip now uses the tool-add-icon tokens like its siblings, instead of a hardcoded gray.
  • CA certificate Upload button is ghost, dropping six hardcoded neutrals.
  • Two dead sidebar shadows. shadow-[0_0_0_1px_hsl(var(--sidebar-border))] resolves to hsl(oklch(...)) after the token migration, which is invalid — that outline has not been rendering. Replaced with ring-*.

Testing

2841 unit tests pass; tsc --noEmit, eslint, and prettier --check clean. One test needed updating: input.test.tsx asserted the input carries shadow-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

  • Form-card fills. Giving the eleven form panels their own surface colour, and retargeting --card (which currently equals --main exactly, so bg-card gives no separation from the page). Parked on form-card-fill; needs rework.
  • ui/input and ui/textarea disagree on placeholder colour — the token vs. hardcoded neutrals, running opposite to each other. ~12 per-form overrides work around it. Fixing it in textarea.tsx is one line but touches every textarea.
  • 47 now-dead shadow-none overrides, left over from cancelling shadows the primitives no longer have.

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>
@a-effort a-effort changed the title style: flatten light-theme surfaces and unify elevation WIP - style: flatten light-theme surfaces and unify elevation Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant