Skip to content

feat: SW-2292 dark-mode styling polish (palette + selected/hover contrast)#179

Open
boramyi-ts wants to merge 3 commits into
mainfrom
SW-2292-dark-mode-styling
Open

feat: SW-2292 dark-mode styling polish (palette + selected/hover contrast)#179
boramyi-ts wants to merge 3 commits into
mainfrom
SW-2292-dark-mode-styling

Conversation

@boramyi-ts

@boramyi-ts boramyi-ts commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What

Dark-mode styling polish for the v1.0.0 GA kit (SW-2292): a brighter dark palette plus higher-contrast selected and hover states. Stock 0.7.0 renders several of these too faintly in dark mode.

Changes

Palette tokens (src/index.tailwind.css, dark .dark {}):

  • --primary#B2D3FF (oklch(0.8578 0.071 255.72)), a clearer sky-blue
  • --secondary#1A2670 (oklch(0.3119 0.1277 270.01)), a deeper navy container
  • --info (dark) → matches --primary (#B2D3FF), mirroring light mode where --info already equals --primary
  • Foreground pairings unchanged (retain AA contrast).

Selected / active states:

  • ToggleGroup selected item → primary fill (both modes). Scoped to group items via twMerge (the item composes toggleVariants), so standalone Toggle keeps its subtle bg-accent on-state.
  • Tabs active (default variant, dark) → lift the chip to color-mix(--card, white 20%) so the selected tab clearly separates from the track (light mode keeps stock bg-card).

Button hovers (stock hovers were near-invisible in dark):

  • Ghost + Outline hover → full accent in dark (drop the faint dark:hover:bg-accent/50 and dark:hover:bg-input/50); outline now matches ghost.
  • Secondary + Default hover → shift the fill 15% toward its own foreground token (a visible darken/lighten in both modes) instead of the stock opacity reduction. Default matches secondary. (Mixing toward the page --foreground was a near-no-op for the light primary in dark — hence each button mixes toward the color chosen to contrast with its own fill.)

Screenshots (dark mode — before = stock 0.7.0, after = this PR)

State Before After
ToggleGroup selected
Tabs active
Secondary button hover
Default button hover
Ghost button hover (subtle: accent/50 → full accent)
Outline button hover (subtle: input/50 → full accent)

Captured from the SW-2041 visual-audit app, which consumes the built package. The button-hover shots show the row with the target button hovered.

Testing

  • yarn lint (zero-warning) + yarn typecheck + yarn test:all (148 files / 1365 tests) ✅
  • Shipped-CSS verified via the postbuild Tailwind compile: .bg-primary/.bg-secondary remain var(--*) (theme-responsive), the .dark {} block carries the new tokens, and the color-mix(...) hover/active utilities emit correctly.
  • twMerge confirmed to drop the inherited bg-accent on-state in favor of bg-primary for ToggleGroup items only.
  • Note: the kit's dev Storybook statically bakes @theme inline colors, so primary/secondary/accent don't reflect the theme toggle there — the shipped build (and the audit app screenshots above) render correctly.

Notes

🤖 Generated with Claude Code

boramyi-ts and others added 2 commits July 15, 2026 11:52
…A2670)

Brighten the dark-mode --primary to a clearer sky-blue and deepen --secondary
to a navy container, per the dark-mode styling review. Values are the OKLCH
equivalents of the approved hex colors; foreground pairings are unchanged and
retain AA contrast (dark #102F72 on the light primary; light #DADEFD on the
navy secondary).

Verified via the postbuild Tailwind compile that the shipped CSS emits
`.bg-primary { background-color: var(--primary) }` / `.bg-secondary {
background-color: var(--secondary) }` and the compiled `.dark {}` block carries
the new token values.

Tabs/ToggleGroup selected-state polish intentionally deferred — main already
diverged from the prototype baseline (bg-card / bg-accent) and needs a design
decision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Port the contrast bumps validated in the visual-audit prototype into the kit
components (0.7.0 stock was too low-contrast in dark mode):

- ToggleGroup selected item -> primary fill (both modes), scoped to group items
  via twMerge so standalone Toggle keeps its subtle bg-accent on-state.
- Tabs active (default variant, dark) -> lift the chip to
  color-mix(--card, white 20%) so it clearly separates from the track.
- Ghost + Outline button hover -> full accent in dark (drop the faint
  dark:hover:bg-accent/50 and dark:hover:bg-input/50); outline matches ghost.
- Secondary + Default button hover -> shift the fill 15% toward its OWN
  foreground token (a visible darken/lighten in both modes) instead of the
  stock opacity reduction; default matches secondary.

Verified: lint, typecheck, test:all; postbuild Tailwind compile emits the
color-mix utilities correctly; twMerge drops the inherited bg-accent for
ToggleGroup items only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts
boramyi-ts requested review from a team as code owners July 15, 2026 16:58
@vercel

vercel Bot commented Jul 15, 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 Jul 15, 2026 7:00pm

Request Review

@boramyi-ts
boramyi-ts temporarily deployed to artifactory-prod July 15, 2026 16:58 — with GitHub Actions Inactive
@boramyi-ts
boramyi-ts enabled auto-merge (squash) July 15, 2026 17:06
…ght mode)

In light mode --info already equals --primary (#2F45B5); in dark they had
diverged (#B9C7FF vs #B2D3FF). Set dark --info to the primary value so info
mirrors primary in both themes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.52% (🎯 83%)
🟰 ±0%
22476 / 23284
🟢 Statements 96.52% (🎯 83%)
🟰 ±0%
22476 / 23284
🟢 Functions 95.75% (🎯 74%)
🟰 ±0%
970 / 1013
🟢 Branches 90.15% (🎯 81%)
⬆️ +0.04%
4266 / 4732
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ui/button.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/tabs.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/toggle-group.tsx 100%
🟰 ±0%
30%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #1006 for commit 0546e36 by the Vitest Coverage Report Action

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