feat(nav+cta): deep accent fill for light CTA text in dark mode, rotating palette swatch

- index.css: --accent-solid / -hover / -active plus --text-on-accent-solid in all
  five palette blocks; the two light blocks duplicate the plain accent values
  verbatim so light mode does not move
- App.css: .btn-primary and .badge-accent take the solid fill with light text and
  a 1px --accent border; hover and active deepen instead of brightening
- ThemePaletteMenu.tsx: the swatch is a motion.span, rotate 90 while the palette
  submenu is open, 0 otherwise; reduced motion stays global (main.tsx)
- language control unchanged (owner decision Q1: keep EN/VI)
- docs: new spec-v3-nav-cta-enhancements.md v0.2.0, palette spec to v0.4.0,
  AGENTS.md accent-tier and rotation bullets

Gates: tsc -b exit 0, oxlint 19 findings (baseline held), 0 hex/rgba in App.css,
vite build green (CSS 33.48 kB), SSR smoke 7/7.
This commit is contained in:
dong.nguyen committed 2026-10-17 14:02:16 +07:00
1 parent 9f6db009e4
commit d7ef4a28e4
6 files changed
+392 -10

No files matched your search

+8 -7
View File
@@ -453,19 +453,20 @@
}
.btn-primary {
background: var(--accent);
color: var(--text-on-accent);
border: 1px solid transparent;
background: var(--accent-solid);
color: var(--text-on-accent-solid);
border: 1px solid var(--accent);
box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
background: var(--accent-hover);
color: var(--text-on-accent);
background: var(--accent-solid-hover);
color: var(--text-on-accent-solid);
transform: translateY(-2px);
box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary:active {
background: var(--accent-solid-active);
transform: translateY(0);
box-shadow: 0 2px 10px var(--accent-glow);
}
@@ -532,8 +533,8 @@
}
.badge-accent {
background: var(--accent);
color: var(--text-on-accent);
background: var(--accent-solid);
color: var(--text-on-accent-solid);
}
.badge-outline {
+11 -1
View File
@@ -1,3 +1,4 @@
import { motion } from 'motion/react'
import { useCallback, useRef, useState } from 'react'
import { useTheme } from '@/hooks/useTheme'
import { useLanguage } from '@/hooks/useLanguage'
@@ -36,7 +37,16 @@ export function ThemePaletteMenu() {
title={strings.nav.paletteAria[lang]}
onClick={() => setOpen((prev) => !prev)}
>
<span className="nav-palette-swatch" aria-hidden="true" />
{/* Rotation tracks the submenu: 90° while it is open, back to 0° on selection, Escape or
a pointer-down outside. Reduced motion is handled globally by
`motion.config.reducedMotion = 'user'` (src/main.tsx:7-9) — the angle changes without
animating. No CSS transition on `.nav-palette-swatch`: motion owns the transform. */}
<motion.span
className="nav-palette-swatch"
aria-hidden="true"
animate={{ rotate: open ? 90 : 0 }}
transition={{ duration: 0.15, ease: 'easeOut' }}
/>
</button>
<div id="palette-menu" className={`nav-palette-panel ${open ? 'open' : ''}`}>
+30
View File
@@ -10,6 +10,14 @@
--accent-hover: #fca5a5;
--accent-active: #f06060;
--text-on-accent: #151914;
/* Solid accent family: the fill of a surface that carries text (buttons, badges). The bright
--accent above stays the signal colour — links, underlines, borders, glows — and the fill of
the accent surfaces this set does not cover. Measured ratios in
docs/design/specs/v3/spec-v3-nav-cta-enhancements.md §4.4. */
--accent-solid: #b04138;
--accent-solid-hover: #a33a32;
--accent-solid-active: #9b3229;
--text-on-accent-solid: #f6f5f2;
--accent-soft: rgba(248, 113, 113, 0.12);
--accent-tint: #2f1e1a;
--accent-glow: rgba(248, 113, 113, 0.3);
@@ -68,6 +76,12 @@
--accent-hover: #a8382f;
--accent-active: #9b3229;
--text-on-accent: #ffffff;
/* Solid accent family — the fill that carries text. These four duplicate --accent,
--accent-hover, --accent-active and --text-on-accent verbatim: light mode does not move. */
--accent-solid: #b04138;
--accent-solid-hover: #a8382f;
--accent-solid-active: #9b3229;
--text-on-accent-solid: #ffffff;
--accent-soft: rgba(176, 65, 56, 0.1);
--accent-tint: #f5e3e1;
--accent-glow: rgba(176, 65, 56, 0.22);
@@ -97,6 +111,12 @@
--accent-hover: #93c5fd;
--accent-active: #3b82f6;
--text-on-accent: #0f1117;
/* Solid accent family — the fill that carries text. Blue starts one step deeper than the
light-mode blue accent: #e8eaed on #2563eb measures 4.29, under the 4.5 text floor. */
--accent-solid: #1d4ed8;
--accent-solid-hover: #1e40af;
--accent-solid-active: #1c3f9e;
--text-on-accent-solid: #e8eaed;
--accent-soft: rgba(96, 165, 250, 0.12);
--accent-tint: #182338;
--accent-glow: rgba(96, 165, 250, 0.3);
@@ -124,6 +144,11 @@
--accent-hover: #1d4ed8;
--accent-active: #1e40af;
--text-on-accent: #ffffff;
/* Solid accent family — the fill that carries text (spec-v3-nav-cta-enhancements.md §4.3) */
--accent-solid: #2563eb;
--accent-solid-hover: #1d4ed8;
--accent-solid-active: #1e40af;
--text-on-accent-solid: #ffffff;
--accent-soft: rgba(37, 99, 235, 0.1);
--accent-tint: #eef3fc;
--accent-glow: rgba(37, 99, 235, 0.22);
@@ -164,6 +189,11 @@
--accent-hover: #a8382f;
--accent-active: #9b3229;
--text-on-accent: #ffffff;
/* Solid accent family — the fill that carries text (spec-v3-nav-cta-enhancements.md §4.3) */
--accent-solid: #b04138;
--accent-solid-hover: #a8382f;
--accent-solid-active: #9b3229;
--text-on-accent-solid: #ffffff;
--accent-soft: rgba(176, 65, 56, 0.1);
--accent-tint: #f5e3e1;
--accent-glow: rgba(176, 65, 56, 0.22);