Skip to content

feat(ui): SW-2016 — unify shadows on elevation tokens 0-7 with dark-mode support (https://tetrascience.atlassian.net/browse/SW-2016)#127

Open
boramyi-ts wants to merge 3 commits into
mainfrom
elevation-tailwind-scale
Open

feat(ui): SW-2016 — unify shadows on elevation tokens 0-7 with dark-mode support (https://tetrascience.atlassian.net/browse/SW-2016)#127
boramyi-ts wants to merge 3 commits into
mainfrom
elevation-tailwind-scale

Conversation

@boramyi-ts

@boramyi-ts boramyi-ts commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Jira: SW-2016

Unifies the kit on the elevation token system by re-valuing --elevation-* to mirror the Tailwind default shadow scale 1:1, extending it to levels 0–7, migrating all 25 production shadow usages to shadow-elevation-*, and adding dark-mode variants. Light mode is pixel-identical by construction (the values are the same — only the syntax changed); dark mode adaptation is the designed change.

Elevation = Tailwind Elevation = Tailwind
0 none 4 shadow-md
1 shadow-2xs 5 shadow-lg
2 shadow-xs 6 shadow-xl
3 shadow-sm 7 shadow-2xl

Changes

  • Tokens (index.tailwind.css): --elevation-0…7 re-valued to the Tailwind scale (shifted one slot); --elevation-6/7 and their @theme mappings are new. Dark variants: same geometry, alphas ×3 (·05→·15, ·10→·30, ·25→·50).
  • Components (19 files): shadow-xs→elevation-2 (×1), sm→3 (×7), md→4 (×11), lg→5 (×5). Zero Tailwind default shadows remain in production components.
  • Dialog — the one deliberate light-mode visual change: moved from elevation-3 (old MD3 value, which this PR re-values underneath it) to elevation-5, keeping overlay-tier weight alongside Sheet.
  • ElevationAndShape story documents all 8 levels with Tailwind equivalents.

Why

Previously two shadow systems coexisted: MD3 elevation tokens (dark-adaptive, 1 consumer) and Tailwind defaults (static, 24 consumers) — so in dark mode nearly every shadow effectively vanished at 10% black on dark surfaces. After this PR every shadowed component adapts, and future shadow re-designs are pure token edits with no component churn.

Before / after

Light — before:
before light

Light — after (identical except Dialog):
after light

Dark — before (Tailwind shadows don't adapt — shadows nearly invisible):
before dark

Dark — after (alphas ×3 — elevation legible on dark surfaces):
after dark

Testing

  • yarn lint / yarn typecheck
  • yarn test:all ✅ — 1093 tests (448 unit + 645 Storybook play)
  • Production build verified: all 8 token pairs (light/dark) in dist/index.css, shadow-elevation-2…7 utilities generated, light values byte-identical to the Tailwind scale.

🤖 Generated with Claude Code

…dopt across components

Re-value the elevation tokens to mirror the Tailwind default shadow
scale 1:1 (2xs→1, xs→2, sm→3, md→4, lg→5, xl→6, 2xl→7), adding
elevation-6 and elevation-7. Migrating a component from shadow-* to
shadow-elevation-* is therefore visually a no-op in light mode.

Replace all 25 production Tailwind shadow usages with the matching
shadow-elevation-* utility; Dialog moves from elevation-3 (old MD3
value) to elevation-5 to keep overlay-tier weight alongside Sheet.

Dark mode: same geometry with alphas tripled (.05→.15, .1→.3, .25→.5)
so elevations stay legible on dark surfaces — previously only Dialog
adapted; now every shadowed component does.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts boramyi-ts requested review from a team as code owners June 11, 2026 19:12
@boramyi-ts boramyi-ts temporarily deployed to artifactory-prod June 11, 2026 19:13 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 93.9% (🎯 83%)
🟰 ±0%
20069 / 21372
🟢 Statements 93.9% (🎯 83%)
🟰 ±0%
20069 / 21372
🟢 Functions 93.04% (🎯 74%)
🟰 ±0%
897 / 964
🟢 Branches 87.27% (🎯 81%)
🟰 ±0%
3498 / 4008
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ai/confirmation.tsx 95.48%
🟰 ±0%
84.37%
🟰 ±0%
100%
🟰 ±0%
95.48%
🟰 ±0%
31-32, 61, 71-72, 165
src/components/ai/queue.tsx 97.2%
🟰 ±0%
83.87%
🟰 ±0%
100%
🟰 ±0%
97.2%
🟰 ±0%
341-346
src/components/composed/PlateMapEditor/PlatePaintGrid.tsx 100%
🟰 ±0%
93.04%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/combobox.tsx 100%
🟰 ±0%
86.95%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/context-menu.tsx 42.46%
🟰 ±0%
100%
🟰 ±0%
40%
🟰 ±0%
42.46%
🟰 ±0%
27-58, 100-215
src/components/ui/dialog.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/dropdown-menu.tsx 45.98%
🟰 ±0%
100%
🟰 ±0%
46.66%
🟰 ±0%
45.98%
🟰 ±0%
14-20, 83-158, 193-250
src/components/ui/hover-card.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/menubar.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/navigation-menu.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/popover.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/select.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/sheet.tsx 95.72%
🟰 ±0%
100%
🟰 ±0%
90%
🟰 ±0%
95.72%
🟰 ±0%
20-24
src/components/ui/sidebar.tsx 94.28%
🟰 ±0%
77.27%
🟰 ±0%
96.15%
🟰 ±0%
94.28%
🟰 ±0%
50-51, 80, 99-106, 183-206, 559
src/components/ui/tabs.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/data-table/data-table-column-toggle.tsx 100%
🟰 ±0%
86.79%
🟰 ±0%
88.88%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/data-table/data-table-filter.tsx 96.03%
🟰 ±0%
76.47%
🟰 ±0%
81.81%
🟰 ±0%
96.03%
🟰 ±0%
61, 92-94, 104-105, 167, 214
src/components/ui/data-table/data-table-group.tsx 96.99%
🟰 ±0%
76.92%
🟰 ±0%
75%
🟰 ±0%
96.99%
🟰 ±0%
35, 67-69
src/components/ui/data-table/data-table.tsx 98.17%
🟰 ±0%
90%
🟰 ±0%
100%
🟰 ±0%
98.17%
🟰 ±0%
116-119, 320, 410-417, 683, 877-878, 882
Generated in workflow #749 for commit ff1e129 by the Vitest Coverage Report Action

@boramyi-ts boramyi-ts enabled auto-merge (squash) June 11, 2026 19:19
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ts-lib-ui-kit-storybook Ready Ready Preview, Comment Jun 17, 2026 6:16pm

Request Review

…t-menu, dropdown-menu, sidebar

Coverage check was failing because the PR touched context-menu.tsx (42%),
dropdown-menu.tsx (45%), and sidebar.tsx (94%) — all below the 95%
new-code threshold.

The changes in the PR were pure CSS class renames (shadow-md →
shadow-elevation-4 etc.), but the coverage check measures per-file
statement coverage for any changed file.

Add Storybook play-function stories that render the previously-untested
exported sub-components:

- context-menu: WithGroup, WithSubMenu, WithCheckboxItems, WithRadioItems
  (covers ContextMenuGroup, ContextMenuLabel, ContextMenuSub,
  ContextMenuSubTrigger, ContextMenuSubContent, ContextMenuCheckboxItem,
  ContextMenuRadioGroup, ContextMenuRadioItem)

- dropdown-menu: WithLabelsAndShortcuts, WithCheckboxItems, WithRadioItems,
  WithSubMenu (covers DropdownMenuGroup, DropdownMenuLabel,
  DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuCheckboxItem,
  DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSub,
  DropdownMenuSubTrigger, DropdownMenuSubContent)

- sidebar: WithShowOnHover, ControlledSidebar, KeyboardShortcutToggle
  (covers showOnHover branch in SidebarMenuAction, controlled open/
  onOpenChange path, and the Ctrl+B keyboard shortcut handler)
auto-merge was automatically disabled June 17, 2026 17:52

Head branch was pushed to by a user without write access

Copilot AI requested a review from 54321jenn-ts June 17, 2026 17:53
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.

2 participants