|
1 | 1 | /* |
2 | 2 | * @btravstack/theme — VitePress style entry. |
3 | 3 | * |
4 | | - * Maps the btravstack design tokens onto VitePress's own `--vp-*` theme |
5 | | - * variables so every btravstack site (this website + the docs sites) shares |
6 | | - * one look. Pulled in automatically by the theme's index.ts; consumers can |
7 | | - * also import it directly as `@btravstack/theme/style.css`. |
| 4 | + * Maps the btravstack design tokens onto VitePress's own `--vp-*` variables so |
| 5 | + * every btravstack site (the website + the docs sites) shares one look. |
| 6 | + * Because the semantic tokens (--bg, --text, --text-accent, …) flip per scheme |
| 7 | + * in tokens.css, this mapping is written once and adapts automatically: |
| 8 | + * - dark → the btravstack plum surfaces, pink links |
| 9 | + * - light → clean warm-white surfaces, brand darkened to deep beetroot |
| 10 | + * (--text-accent) so links/headings pass WCAG-AA on white |
8 | 11 | * |
9 | | - * Theming covers BOTH color schemes, so it's safe to let VitePress follow |
10 | | - * the visitor's OS preference (its default, `appearance: true`): |
11 | | - * - dark → adopts the btravstack surface palette |
12 | | - * - light → keeps VitePress's light surfaces, with the brand darkened to |
13 | | - * the deep beetroot so links/headings pass WCAG-AA on white. |
| 12 | + * The `:root:root` selector raises specificity to (0,2,0) so the mapping wins |
| 13 | + * over VitePress's own `:root` / `.dark` defaults regardless of load order. |
14 | 14 | */ |
15 | 15 | @import "./fonts.css"; |
16 | 16 | @import "./tokens.css"; |
17 | 17 |
|
18 | | -/* ── Brand defaults + typography (both schemes) ────────────────── */ |
19 | | -/* `:root:root` / `:root.dark` raise specificity to (0,2,0) so these win |
20 | | - over VitePress's own `:root` / `.dark` defaults regardless of the order |
21 | | - the remote @import lands in the cascade. */ |
22 | 18 | :root:root { |
23 | | - --vp-c-brand-1: var(--accent); |
24 | | - --vp-c-brand-2: var(--bt-magenta); |
25 | | - --vp-c-brand-3: var(--accent-deep); |
26 | | - --vp-c-brand-soft: rgba(var(--accent-rgb), 0.14); |
27 | | - --vp-c-brand: var(--accent); /* legacy alias */ |
28 | | - |
29 | | - --vp-font-family-base: var(--sans); |
30 | | - --vp-font-family-mono: var(--mono); |
31 | | - |
32 | | - /* Solid brand buttons — dark ink on the pink fill, readable in both schemes */ |
33 | | - --vp-button-brand-bg: var(--accent); |
34 | | - --vp-button-brand-text: var(--accent-contrast); |
35 | | - --vp-button-brand-border: transparent; |
36 | | - --vp-button-brand-hover-bg: var(--bt-magenta); |
37 | | - --vp-button-brand-hover-text: var(--accent-contrast); |
38 | | - --vp-button-brand-hover-border: transparent; |
39 | | - --vp-button-brand-active-bg: var(--accent-deep); |
40 | | - --vp-button-brand-active-text: var(--bt-cream); |
41 | | - --vp-button-brand-active-border: transparent; |
42 | | - |
43 | | - /* Home hero: gradient name + beetroot glow behind the logo */ |
44 | | - --vp-home-hero-name-color: transparent; |
45 | | - --vp-home-hero-name-background: linear-gradient(120deg, var(--accent), var(--bt-pink-soft)); |
46 | | - --vp-home-hero-image-background-image: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.30), transparent 72%); |
47 | | - --vp-home-hero-image-filter: blur(8px); |
48 | | -} |
49 | | - |
50 | | -/* ── Light scheme: darken the brand so it passes WCAG-AA on white ── */ |
51 | | -:root:not(.dark) { |
52 | | - --vp-c-brand-1: var(--accent-deep); /* link / active text — ~7:1 on white */ |
53 | | - --vp-c-brand-2: var(--bt-deep-2); /* hover, a touch darker */ |
54 | | - --vp-c-brand-3: var(--accent-deep); |
55 | | - --vp-c-brand-soft: rgba(var(--accent-rgb), 0.10); |
56 | | - /* deeper gradient so the hero name reads on a light background */ |
57 | | - --vp-home-hero-name-background: linear-gradient(120deg, var(--accent-deep), var(--bt-magenta)); |
58 | | -} |
59 | | - |
60 | | -/* ── Dark scheme: btravstack surfaces (matches the landing page) ── */ |
61 | | -:root.dark { |
62 | | - --vp-c-bg: var(--bg); |
63 | | - --vp-c-bg-alt: var(--card); |
| 19 | + /* Surfaces / text / dividers — scheme-aware via the semantic tokens */ |
| 20 | + --vp-c-bg: var(--bg); |
| 21 | + --vp-c-bg-alt: var(--card); |
64 | 22 | --vp-c-bg-soft: var(--card-soft); |
65 | | - --vp-c-bg-elv: var(--card); |
| 23 | + --vp-c-bg-elv: var(--card); |
66 | 24 |
|
67 | 25 | --vp-c-text-1: var(--text); |
68 | 26 | --vp-c-text-2: var(--muted); |
69 | 27 | --vp-c-text-3: var(--faint); |
70 | 28 |
|
71 | 29 | --vp-c-divider: var(--border); |
72 | | - --vp-c-border: var(--border-2); |
73 | | - --vp-c-gutter: var(--border); |
| 30 | + --vp-c-border: var(--border-2); |
| 31 | + --vp-c-gutter: var(--border); |
74 | 32 |
|
75 | | - --vp-c-brand-1: var(--accent); /* pink reads great on dark */ |
76 | | - --vp-c-brand-2: var(--bt-pink-soft); |
| 33 | + /* Brand — links/active use accent-as-TEXT (darkens on light for AA) */ |
| 34 | + --vp-c-brand-1: var(--text-accent); |
| 35 | + --vp-c-brand-2: var(--bt-pink-soft); |
| 36 | + --vp-c-brand-3: var(--accent-deep); |
77 | 37 | --vp-c-brand-soft: rgba(var(--accent-rgb), 0.16); |
| 38 | + --vp-c-brand: var(--text-accent); /* legacy alias */ |
78 | 39 |
|
79 | | - /* Inline + block code */ |
| 40 | + /* Inline code */ |
80 | 41 | --vp-code-color: var(--bt-pink-soft); |
81 | | - --vp-code-bg: rgba(0, 0, 0, 0.35); |
| 42 | + --vp-code-bg: var(--code-bg); |
| 43 | + |
| 44 | + --vp-font-family-base: var(--sans); |
| 45 | + --vp-font-family-mono: var(--mono); |
| 46 | + |
| 47 | + /* Solid brand buttons — dark ink on the pink FILL, readable in both schemes */ |
| 48 | + --vp-button-brand-bg: var(--accent); |
| 49 | + --vp-button-brand-text: var(--accent-contrast); |
| 50 | + --vp-button-brand-border: transparent; |
| 51 | + --vp-button-brand-hover-bg: var(--bt-magenta); |
| 52 | + --vp-button-brand-hover-text: var(--accent-contrast); |
| 53 | + --vp-button-brand-hover-border: transparent; |
| 54 | + --vp-button-brand-active-bg: var(--accent-deep); |
| 55 | + --vp-button-brand-active-text: var(--bt-cream); |
| 56 | + --vp-button-brand-active-border: transparent; |
| 57 | + |
| 58 | + /* Custom-block (admonition) tints */ |
| 59 | + --vp-custom-block-tip-bg: rgba(var(--green-rgb), 0.08); |
| 60 | + --vp-custom-block-tip-border: rgba(var(--green-rgb), 0.30); |
| 61 | + --vp-custom-block-tip-text: var(--text-green); |
| 62 | + --vp-custom-block-warning-bg: rgba(var(--accent-rgb), 0.08); |
| 63 | + --vp-custom-block-warning-border: var(--accent-line); |
| 64 | + --vp-custom-block-warning-text: var(--text-accent); |
| 65 | + |
| 66 | + /* Home hero: gradient name + beetroot glow behind the logo */ |
| 67 | + --vp-home-hero-name-color: transparent; |
| 68 | + --vp-home-hero-name-background: linear-gradient(120deg, var(--text-accent), var(--bt-pink-soft)); |
| 69 | + --vp-home-hero-image-background-image: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.30), transparent 72%); |
| 70 | + --vp-home-hero-image-filter: blur(8px); |
82 | 71 | } |
83 | 72 |
|
84 | 73 | /* ── Playful flourishes — shared across every btravstack site ───── */ |
|
0 commit comments