|
| 1 | +/* Design tokens for Example. |
| 2 | + * |
| 3 | + * These are deliberately neutral placeholders, not a finished palette. Replace |
| 4 | + * the values with the brand's own before shipping; the names are the contract |
| 5 | + * consumers depend on, so prefer changing values over renaming. |
| 6 | + * |
| 7 | + * Names describe the role a color plays, not a material it imitates. |
| 8 | + */ |
| 9 | + |
1 | 10 | :root { |
2 | | - --example-color-paper: #f5f5f0; |
3 | | - --example-color-ink: #151515; |
4 | | - --example-color-muted: #666660; |
5 | | - --example-color-line: #d0d0c8; |
6 | | - --example-color-accent: #6cff8f; |
| 11 | + /* surfaces */ |
| 12 | + --example-bg: #ffffff; |
| 13 | + --example-bg-raised: #f6f6f6; |
| 14 | + |
| 15 | + /* text */ |
| 16 | + --example-fg: #171717; |
| 17 | + --example-fg-muted: #5c5c5c; |
| 18 | + |
| 19 | + /* structure */ |
| 20 | + --example-border: #e0e0e0; |
| 21 | + |
| 22 | + /* Focus is a functional requirement, not decoration. It needs at least 3:1 |
| 23 | + * against both surfaces above; check it whenever the palette changes. */ |
| 24 | + --example-focus: #1a56c4; |
| 25 | + |
7 | 26 | --example-font-sans: ui-sans-serif, system-ui, sans-serif; |
8 | 27 | --example-font-mono: ui-monospace, monospace; |
9 | | - --wa-color-surface-default: var(--example-color-paper); |
10 | | - --wa-color-text-normal: var(--example-color-ink); |
11 | | - --wa-color-brand-fill-loud: var(--example-color-accent); |
| 28 | + |
| 29 | + /* Bridge into Web Awesome. Only surfaces, text, and borders are mapped: |
| 30 | + * Web Awesome's brand color is the consumer's to choose, so it is left at |
| 31 | + * the library default rather than pointed at a placeholder. */ |
| 32 | + --wa-color-surface-default: var(--example-bg); |
| 33 | + --wa-color-surface-raised: var(--example-bg-raised); |
| 34 | + --wa-color-text-normal: var(--example-fg); |
| 35 | + --wa-color-text-quiet: var(--example-fg-muted); |
| 36 | + |
12 | 37 | color-scheme: light; |
13 | 38 | } |
14 | 39 |
|
15 | 40 | :root[data-theme='dark'] { |
16 | | - --example-color-paper: #151515; |
17 | | - --example-color-ink: #f5f5f0; |
18 | | - --example-color-muted: #aaa9a0; |
19 | | - --example-color-line: #3a3a36; |
| 41 | + --example-bg: #121212; |
| 42 | + --example-bg-raised: #1c1c1c; |
| 43 | + --example-fg: #ededed; |
| 44 | + --example-fg-muted: #a6a6a6; |
| 45 | + --example-border: #333333; |
| 46 | + --example-focus: #8ab4ff; |
| 47 | + |
20 | 48 | color-scheme: dark; |
21 | 49 | } |
22 | 50 |
|
23 | 51 | :root { |
24 | | - color: var(--example-color-ink); |
| 52 | + color: var(--example-fg); |
25 | 53 | font-family: var(--example-font-sans); |
26 | | - background: var(--example-color-paper); |
| 54 | + background: var(--example-bg); |
27 | 55 | } |
28 | 56 |
|
29 | 57 | body { |
30 | 58 | margin: 0; |
31 | 59 | } |
32 | 60 |
|
33 | 61 | main { |
34 | | - width: min(calc(100% - 3rem), 72rem); |
| 62 | + width: min(calc(100% - 3rem), 64rem); |
35 | 63 | margin: 0 auto; |
36 | | - padding: 6rem 0; |
| 64 | + padding: 3rem 0 6rem; |
37 | 65 | } |
38 | 66 |
|
39 | | -.eyebrow { |
40 | | - color: var(--example-color-muted); |
41 | | - font-family: var(--example-font-mono); |
42 | | - font-size: 0.75rem; |
43 | | - letter-spacing: 0.14em; |
44 | | - text-transform: uppercase; |
| 67 | +button:focus-visible, |
| 68 | +a:focus-visible { |
| 69 | + outline: 2px solid var(--example-focus); |
| 70 | + outline-offset: 4px; |
45 | 71 | } |
0 commit comments