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

+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' : ''}`}>