@noix-dev/brix-tokens 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/package.json +36 -3
- package/src/canvasColor.ts +39 -0
- package/src/contract.json +683 -0
- package/src/contrast.ts +319 -0
- package/src/density.css +565 -0
- package/src/fonts.css +10 -0
- package/src/index.css +125 -0
- package/src/perceptual.ts +99 -0
- package/src/themes/graphite.css +265 -0
- package/src/themes/kingfisher.css +397 -0
- package/src/themes/noix.css +266 -0
- package/src/themes/registry.json +5 -0
- package/src/variants.css +94 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/* ---------------------------------------------------------------------------
|
|
2
|
+
kingfisher — deep teal and orange, after the bird whose plumage is this exact
|
|
3
|
+
pairing. A dense, data-heavy look: neutral greys carry the surfaces and the
|
|
4
|
+
brand hues are spent on what has to be found.
|
|
5
|
+
|
|
6
|
+
Every role in contract.json is bound in both modes. The dark rule carries two
|
|
7
|
+
selectors because the mode class and `data-brix-theme` normally land on the same
|
|
8
|
+
element (the document root), while a preview can put the theme on a subtree
|
|
9
|
+
under a dark page; one block serves both.
|
|
10
|
+
--------------------------------------------------------------------------- */
|
|
11
|
+
|
|
12
|
+
[data-brix-theme='kingfisher'] {
|
|
13
|
+
/* Surfaces and ink: neutral, so the brand hues stay the signal. */
|
|
14
|
+
--background: oklch(1 0 0);
|
|
15
|
+
--foreground: oklch(0.145 0 0);
|
|
16
|
+
--card: oklch(1 0 0);
|
|
17
|
+
--card-foreground: oklch(0.145 0 0);
|
|
18
|
+
--popover: oklch(1 0 0);
|
|
19
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
20
|
+
--muted: oklch(0.97 0 0);
|
|
21
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
22
|
+
--secondary: oklch(0.97 0 0);
|
|
23
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
24
|
+
--accent: oklch(0.97 0 0);
|
|
25
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
26
|
+
--border: oklch(0.922 0 0);
|
|
27
|
+
--input: oklch(0.922 0 0);
|
|
28
|
+
|
|
29
|
+
/* The brand ramp. One ramp serves both modes: application code picks the rung
|
|
30
|
+
per mode (`text-brand dark:text-brand-light`), so the rungs themselves do not
|
|
31
|
+
change when the mode does. Contrast on white: the brand 9.3:1. */
|
|
32
|
+
--brand: #0d4f4f;
|
|
33
|
+
--brand-light: #5eead4;
|
|
34
|
+
--brand-dark: #0a3d3d;
|
|
35
|
+
--brand-deep: #073030;
|
|
36
|
+
--brand-alt: #e8732a;
|
|
37
|
+
--brand-alt-light: #fb923c;
|
|
38
|
+
--brand-alt-dark: #d4621f;
|
|
39
|
+
/* Caps field labels on sign-in and account screens: a teal-tinted grey, a touch
|
|
40
|
+
darker than --muted-foreground. */
|
|
41
|
+
--brand-ink: #5b6b6b;
|
|
42
|
+
|
|
43
|
+
/* State. --primary-foreground is white here: every hue the theme uses as
|
|
44
|
+
--primary clears WCAG AA against it. */
|
|
45
|
+
--primary: var(--brand);
|
|
46
|
+
--primary-foreground: #ffffff;
|
|
47
|
+
--ring: var(--brand);
|
|
48
|
+
/* The primary hue as TEXT on a 10% wash of itself — an active filter chip, and
|
|
49
|
+
anything else that tints its own background. A hue that merely clears WCAG AA
|
|
50
|
+
on white does not clear it on that wash, so this is a separate token rather
|
|
51
|
+
than --primary; see the amber accent set below for the one place they differ. */
|
|
52
|
+
--primary-on-wash: var(--primary);
|
|
53
|
+
/* These two reds are hex on purpose, and the hex is not a redesign. This theme's
|
|
54
|
+
destructive used to be oklch(0.577 0.245 27.325), whose green channel converts
|
|
55
|
+
to -0.122: outside sRGB, so no screen ever showed it, every browser clamped it
|
|
56
|
+
its own way, and src/contrast.ts refused to measure it rather than report
|
|
57
|
+
headroom the screen cannot give. #e30117 is that colour clamped to the sRGB
|
|
58
|
+
boundary, and #ff6568 in the dark block below is the same for
|
|
59
|
+
oklch(0.704 0.191 22.216). Restoring either oklch would look like a tidy-up and
|
|
60
|
+
would put the gate back where it cannot answer. */
|
|
61
|
+
--destructive: #e30117;
|
|
62
|
+
/* Not var(--destructive), which is what the other two themes write and what this
|
|
63
|
+
theme's own dark block writes: the clamped solid measures 4.115 as its own ink
|
|
64
|
+
on a 10% wash of itself over --background, under the 4.5 the pair is gated at.
|
|
65
|
+
The same hue darkened until it clears, at 4.626. In dark the solid is light on
|
|
66
|
+
a dark ground and reaches 6.229 on its own wash, so there it does alias. */
|
|
67
|
+
--destructive-on-wash: #d40014;
|
|
68
|
+
--warning: #b45309;
|
|
69
|
+
--warning-foreground: #ffffff;
|
|
70
|
+
--warning-on-wash: #7c4206;
|
|
71
|
+
/* Success: "saved", "done", "connected". A status colour is meaning, so it is a role
|
|
72
|
+
and not a fixed palette hue. The fill clears 3:1 on --background (it is read as a
|
|
73
|
+
state, WCAG 1.4.11); the ink on the fill and on a 10% wash of it clear 4.5:1. All
|
|
74
|
+
three are in-gamut hex, so none is a boundary clamp. */
|
|
75
|
+
--success: #047857;
|
|
76
|
+
--success-foreground: #ffffff;
|
|
77
|
+
--success-on-wash: #065f46;
|
|
78
|
+
|
|
79
|
+
/* Progress bands (high >= 70, mid >= 30, low below), read as an inline
|
|
80
|
+
`var(--progress-*)` so one inline style serves both modes. Literal values, not
|
|
81
|
+
references: a band hue computed in script is invisible to a grep, so these two
|
|
82
|
+
blocks are the only place one is written down, and the contrast test holds the
|
|
83
|
+
dark ones to 4.5:1. Light values are the brand teal, the brand orange and a
|
|
84
|
+
deep red. */
|
|
85
|
+
--progress-high: #0d4f4f;
|
|
86
|
+
--progress-mid: #e8732a;
|
|
87
|
+
--progress-low: #b91c1c;
|
|
88
|
+
|
|
89
|
+
/* Shape and type. A theme only names the family; delivering the webfont stays
|
|
90
|
+
the application's choice (see fonts.css). */
|
|
91
|
+
--radius: 0.625rem;
|
|
92
|
+
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
|
|
93
|
+
--font-heading: var(--font-sans);
|
|
94
|
+
|
|
95
|
+
--chart-1: oklch(0.87 0 0);
|
|
96
|
+
--chart-2: oklch(0.556 0 0);
|
|
97
|
+
--chart-3: oklch(0.439 0 0);
|
|
98
|
+
--chart-4: oklch(0.371 0 0);
|
|
99
|
+
--chart-5: oklch(0.269 0 0);
|
|
100
|
+
|
|
101
|
+
/* Series roles for charts with several series, read from the document by the
|
|
102
|
+
chart family. One set per mode, shared by every theme: lightness steps of about
|
|
103
|
+
0.10 in OKLab L plus a hue spread, chroma fitted per hue to stay inside sRGB. The
|
|
104
|
+
contrast test holds them 3:1 off --card and 0.09 apart under every vision. */
|
|
105
|
+
--series-1: #460011;
|
|
106
|
+
--series-2: #4d3a05;
|
|
107
|
+
--series-3: #096c45;
|
|
108
|
+
--series-4: #0985b2;
|
|
109
|
+
--series-5: #b575ff;
|
|
110
|
+
|
|
111
|
+
/* Code editor. One syntax set serves every theme and both modes, because the editor
|
|
112
|
+
is a dark surface even under a light page: the surface and ink are this theme's own
|
|
113
|
+
dark card and foreground, restated in both blocks. The gate holds each syntax role
|
|
114
|
+
4.5:1 off --code-surface and 0.08 apart under every vision. --code-selection is
|
|
115
|
+
this theme's --brand-light at 40%. It is bound to that rung rather than to a role,
|
|
116
|
+
because a role follows the mode and this surface does not, and it is written out as
|
|
117
|
+
a literal because the gate reads declared values and cannot parse a color-mix. */
|
|
118
|
+
--syntax-tag: oklch(0.7 0.15 278);
|
|
119
|
+
--syntax-attribute: oklch(0.82 0.16 76);
|
|
120
|
+
--syntax-string: oklch(0.84 0.19 154);
|
|
121
|
+
--syntax-keyword: oklch(0.78 0.1 298);
|
|
122
|
+
--syntax-number: oklch(0.7 0.11 62);
|
|
123
|
+
--syntax-comment: oklch(0.62 0.025 60);
|
|
124
|
+
--syntax-meta: oklch(0.74 0.13 178);
|
|
125
|
+
--syntax-invalid: oklch(0.66 0.27 344);
|
|
126
|
+
--code-surface: oklch(0.205 0 0);
|
|
127
|
+
--code-foreground: oklch(0.985 0 0);
|
|
128
|
+
--code-selection: #5eead466;
|
|
129
|
+
|
|
130
|
+
--sidebar: oklch(0.985 0 0);
|
|
131
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
132
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
133
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
134
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
135
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
136
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
137
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
138
|
+
|
|
139
|
+
/* Neutral fallback for everything outside an accent set, so the accent
|
|
140
|
+
utilities resolve on a page that sets no [data-brix-accent]. */
|
|
141
|
+
--accent-base: var(--brand);
|
|
142
|
+
--accent-tint: #eef2f2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dark [data-brix-theme='kingfisher'],
|
|
146
|
+
[data-brix-theme='kingfisher'].dark {
|
|
147
|
+
--background: oklch(0.145 0 0);
|
|
148
|
+
--foreground: oklch(0.985 0 0);
|
|
149
|
+
--card: oklch(0.205 0 0);
|
|
150
|
+
--card-foreground: oklch(0.985 0 0);
|
|
151
|
+
--popover: oklch(0.205 0 0);
|
|
152
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
153
|
+
--muted: oklch(0.269 0 0);
|
|
154
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
155
|
+
--secondary: oklch(0.269 0 0);
|
|
156
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
157
|
+
--accent: oklch(0.269 0 0);
|
|
158
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
159
|
+
--border: oklch(1 0 0 / 10%);
|
|
160
|
+
--input: oklch(1 0 0 / 15%);
|
|
161
|
+
|
|
162
|
+
/* The ramp is restated, not inherited: the light rule matches this same element
|
|
163
|
+
and its declarations would beat anything inherited from an ancestor. Same
|
|
164
|
+
rungs, same values — what changes in dark mode is which rung a utility picks.
|
|
165
|
+
|
|
166
|
+
With one exception, and it is a real one: --brand-ink below. That rung IS the
|
|
167
|
+
ink (the caps field labels on sign-in and account screens), so there is no
|
|
168
|
+
second rung for a utility to pick, and #5b6b6b restated unchanged measures
|
|
169
|
+
3.54:1 on this --background — below AA. graphite and noix both change
|
|
170
|
+
--brand-ink in their dark blocks and say why in terms that apply here word for
|
|
171
|
+
word. This theme carries an existing look over and the value is frozen by
|
|
172
|
+
tests/kingfisher.test.ts, so the failure is inherited rather than introduced;
|
|
173
|
+
it is not therefore invisible. CLAUDE.md's invariant 3 holds it with the four
|
|
174
|
+
other unmeasured pairings, and the five are one palette decision. */
|
|
175
|
+
--brand: #0d4f4f;
|
|
176
|
+
--brand-light: #5eead4;
|
|
177
|
+
--brand-dark: #0a3d3d;
|
|
178
|
+
--brand-deep: #073030;
|
|
179
|
+
--brand-alt: #e8732a;
|
|
180
|
+
--brand-alt-light: #fb923c;
|
|
181
|
+
--brand-alt-dark: #d4621f;
|
|
182
|
+
--brand-ink: #5b6b6b;
|
|
183
|
+
|
|
184
|
+
/* The light rungs carry the brand on the dark ground, and the deep teal becomes
|
|
185
|
+
the ink on top of them. */
|
|
186
|
+
--primary: var(--brand-light);
|
|
187
|
+
--primary-foreground: var(--brand-deep);
|
|
188
|
+
--ring: var(--brand-light);
|
|
189
|
+
/* The dark-mode hues are light on a dark ground, where the wash darkens nothing
|
|
190
|
+
the text has to fight; they stand as they are. */
|
|
191
|
+
--primary-on-wash: var(--brand-light);
|
|
192
|
+
/* The sRGB-boundary clamp of oklch(0.704 0.191 22.216); see the light block. */
|
|
193
|
+
--destructive: #ff6568;
|
|
194
|
+
--destructive-on-wash: var(--destructive);
|
|
195
|
+
--warning: #f0b429;
|
|
196
|
+
--warning-foreground: #1a1205;
|
|
197
|
+
--warning-on-wash: #fbbf24;
|
|
198
|
+
/* Light rung on a dark ground, like the warning family. The ink on the fill is the
|
|
199
|
+
deepest emerald rather than black, so the pair reads as one hue. */
|
|
200
|
+
--success: #34d399;
|
|
201
|
+
--success-foreground: #052e1f;
|
|
202
|
+
--success-on-wash: #6ee7b7;
|
|
203
|
+
|
|
204
|
+
/* The light bands do not survive the dark ground (the teal is 2.1:1 on
|
|
205
|
+
--background, the red 3.1:1), so each is lightened the way the accent hues are:
|
|
206
|
+
the light brand rungs and a light red. Measured against --background / --card /
|
|
207
|
+
--muted (the bar track and a hovered row): 13.4 / 12.1 / 10.2, 8.8 / 7.9 / 6.7
|
|
208
|
+
and 7.2 / 6.5 / 5.5. */
|
|
209
|
+
--progress-high: #5eead4;
|
|
210
|
+
--progress-mid: #fb923c;
|
|
211
|
+
--progress-low: #f87171;
|
|
212
|
+
|
|
213
|
+
--radius: 0.625rem;
|
|
214
|
+
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
|
|
215
|
+
--font-heading: var(--font-sans);
|
|
216
|
+
|
|
217
|
+
--chart-1: oklch(0.87 0 0);
|
|
218
|
+
--chart-2: oklch(0.556 0 0);
|
|
219
|
+
--chart-3: oklch(0.439 0 0);
|
|
220
|
+
--chart-4: oklch(0.371 0 0);
|
|
221
|
+
--chart-5: oklch(0.269 0 0);
|
|
222
|
+
|
|
223
|
+
/* Series roles for charts with several series, read from the document by the
|
|
224
|
+
chart family. One set per mode, shared by every theme: lightness steps of about
|
|
225
|
+
0.10 in OKLab L plus a hue spread, chroma fitted per hue to stay inside sRGB. The
|
|
226
|
+
contrast test holds them 3:1 off --card and 0.09 apart under every vision. */
|
|
227
|
+
--series-1: #916748;
|
|
228
|
+
--series-2: #82986a;
|
|
229
|
+
--series-3: #77bcc0;
|
|
230
|
+
--series-4: #becbfc;
|
|
231
|
+
--series-5: #fee7f3;
|
|
232
|
+
|
|
233
|
+
/* Code editor. One syntax set serves every theme and both modes, because the editor
|
|
234
|
+
is a dark surface even under a light page: the surface and ink are this theme's own
|
|
235
|
+
dark card and foreground, restated in both blocks. The gate holds each syntax role
|
|
236
|
+
4.5:1 off --code-surface and 0.08 apart under every vision. --code-selection is
|
|
237
|
+
this theme's --brand-light at 40%. It is bound to that rung rather than to a role,
|
|
238
|
+
because a role follows the mode and this surface does not, and it is written out as
|
|
239
|
+
a literal because the gate reads declared values and cannot parse a color-mix. */
|
|
240
|
+
--syntax-tag: oklch(0.7 0.15 278);
|
|
241
|
+
--syntax-attribute: oklch(0.82 0.16 76);
|
|
242
|
+
--syntax-string: oklch(0.84 0.19 154);
|
|
243
|
+
--syntax-keyword: oklch(0.78 0.1 298);
|
|
244
|
+
--syntax-number: oklch(0.7 0.11 62);
|
|
245
|
+
--syntax-comment: oklch(0.62 0.025 60);
|
|
246
|
+
--syntax-meta: oklch(0.74 0.13 178);
|
|
247
|
+
--syntax-invalid: oklch(0.66 0.27 344);
|
|
248
|
+
--code-surface: oklch(0.205 0 0);
|
|
249
|
+
--code-foreground: oklch(0.985 0 0);
|
|
250
|
+
--code-selection: #5eead466;
|
|
251
|
+
|
|
252
|
+
--sidebar: oklch(0.205 0 0);
|
|
253
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
254
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
255
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
256
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
257
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
258
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
259
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
260
|
+
|
|
261
|
+
--accent-base: var(--brand-light);
|
|
262
|
+
--accent-tint: color-mix(in oklab, var(--brand-light) 10%, transparent);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* ---------------------------------------------------------------------------
|
|
266
|
+
Accent sets.
|
|
267
|
+
|
|
268
|
+
An application puts `data-brix-accent` on a wrapper around a section, and these rules
|
|
269
|
+
rebind the brand tokens underneath it. Everything already drawn in the primary
|
|
270
|
+
hue — buttons, focus rings, chips, table headers — follows the section
|
|
271
|
+
automatically, so no screen has to know the mechanism exists. The sets are
|
|
272
|
+
scoped to the theme: another theme brings its own, or none at all.
|
|
273
|
+
|
|
274
|
+
Each set lists every way its three attributes can be arranged, for the same reason
|
|
275
|
+
the theme rules carry two preludes. `data-brix-accent` is normally on a wrapper under the
|
|
276
|
+
theme element, but an application with one accent throughout sets it on the document
|
|
277
|
+
root beside `data-brix-theme` — and a descendant-only rule would give that application no
|
|
278
|
+
accent at all. So: the accent element is the theme element or a descendant of it, and
|
|
279
|
+
in dark mode the mode class is on the theme element or above it. Four combinations in
|
|
280
|
+
dark, two in light. Each dark prelude outranks the light prelude it competes with by
|
|
281
|
+
the one extra `.dark`, and a selector list is weighed one selector at a time.
|
|
282
|
+
|
|
283
|
+
--primary-foreground is left alone: white in light mode (each hue clears WCAG AA
|
|
284
|
+
against it), the deep teal in dark mode (where the hues are light).
|
|
285
|
+
|
|
286
|
+
Every set restates --primary-on-wash, in both modes, even where it is simply its
|
|
287
|
+
own --primary. A `var()` inside a custom property is substituted on the element
|
|
288
|
+
that declares it, and the result is what inherits — so `--primary-on-wash:
|
|
289
|
+
var(--primary)` written on the theme element hands every section the theme's hue,
|
|
290
|
+
not the section's. Measured in a browser: with --primary rebound to #3c4f9e on a
|
|
291
|
+
child, the inherited --primary-on-wash still computed to the ancestor's #0d4f4f.
|
|
292
|
+
--------------------------------------------------------------------------- */
|
|
293
|
+
|
|
294
|
+
/* Contrast on white: 9.3:1 — passes WCAG AA for text. */
|
|
295
|
+
[data-brix-theme='kingfisher'] [data-brix-accent='teal'],
|
|
296
|
+
[data-brix-theme='kingfisher'][data-brix-accent='teal'] {
|
|
297
|
+
--primary: #0d4f4f;
|
|
298
|
+
--ring: #0d4f4f;
|
|
299
|
+
--primary-on-wash: #0d4f4f;
|
|
300
|
+
--accent-base: #0d4f4f;
|
|
301
|
+
--accent-tint: #e7efef;
|
|
302
|
+
/* The header text is darkened along with the wash. A table header renders
|
|
303
|
+
--muted-foreground (#737373) at 10px bold, which clears AA on white by 4.73:1 —
|
|
304
|
+
no headroom at all. On these tints it drops to 4.05-4.20:1, so the wash alone
|
|
305
|
+
would push every list below AA, and the column labels are the only thing that
|
|
306
|
+
says what the numbers under them mean. #5a5a5a restores 5.9:1 on all three.
|
|
307
|
+
Darkening the ink rather than lightening the wash keeps the accent signal at
|
|
308
|
+
full strength — the wash is what carries it.
|
|
309
|
+
|
|
310
|
+
DORMANT, and nothing can read it as it stands. --accent-head-ink is not in
|
|
311
|
+
contract.json's roles, so graphite and noix are not required to bind it and do
|
|
312
|
+
not, not even as a theme-level fallback; index.css's `@theme inline` has no
|
|
313
|
+
--color-accent-head-ink, so `text-accent-head-ink` does not compile at all; and
|
|
314
|
+
nothing in the repository reads it except tests/kingfisher.test.ts, which pins
|
|
315
|
+
the value below. So the cure measured above is unavailable to the component that
|
|
316
|
+
needs it, and the demo's table heads draw the 4.05-4.20 pairing instead.
|
|
317
|
+
|
|
318
|
+
It is left declared rather than promoted or deleted on purpose: the spec counts
|
|
319
|
+
the accent-set tokens as contract surface and the plan says accent sets are not
|
|
320
|
+
in `roles`, --accent-base and --accent-tint were promoted and this one was not,
|
|
321
|
+
and settling that disagreement is a planning decision. CLAUDE.md's invariant 11
|
|
322
|
+
records the state and the three changes it would take together to make the token
|
|
323
|
+
usable. Until all three land, do not reach for it. */
|
|
324
|
+
--accent-head-ink: #5a5a5a;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* Contrast on white: 4.9:1 — passes, with the least headroom of the three. */
|
|
328
|
+
[data-brix-theme='kingfisher'] [data-brix-accent='amber'],
|
|
329
|
+
[data-brix-theme='kingfisher'][data-brix-accent='amber'] {
|
|
330
|
+
--primary: #b4551a;
|
|
331
|
+
--ring: #b4551a;
|
|
332
|
+
/* The only set whose primary cannot double as text on its own wash: #b4551a clears
|
|
333
|
+
AA on white by 4.94:1, and a 10% wash of it takes that to 4.31 — under the bar,
|
|
334
|
+
on the label of an active filter chip at 12.8px. The darker ink restores 6.2:1,
|
|
335
|
+
level with indigo (6.4) and teal (7.9), so no set is the weak one. Measured in a
|
|
336
|
+
running application; the hue itself is unchanged, so border, badge and wash still
|
|
337
|
+
read as the brand orange. */
|
|
338
|
+
--primary-on-wash: #8f4214;
|
|
339
|
+
/* The bright orange is 3.0:1 on white and fails for text. It is reserved for the
|
|
340
|
+
accent — the bar and the group dot — and is never a text or button-fill colour. */
|
|
341
|
+
--accent-base: #e8732a;
|
|
342
|
+
--accent-tint: #fcefe6;
|
|
343
|
+
--accent-head-ink: #5a5a5a;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* Contrast on white: 7.5:1 — passes WCAG AA for text. */
|
|
347
|
+
[data-brix-theme='kingfisher'] [data-brix-accent='indigo'],
|
|
348
|
+
[data-brix-theme='kingfisher'][data-brix-accent='indigo'] {
|
|
349
|
+
--primary: #3c4f9e;
|
|
350
|
+
--ring: #3c4f9e;
|
|
351
|
+
--primary-on-wash: #3c4f9e;
|
|
352
|
+
--accent-base: #3c4f9e;
|
|
353
|
+
--accent-tint: #ebeef8;
|
|
354
|
+
--accent-head-ink: #5a5a5a;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* The dark counterparts, lightened to read on the dark ground. Each one restates the
|
|
358
|
+
whole set: the light rule above matches this same element, and a declaration on the
|
|
359
|
+
element beats one inherited from the theme's dark rule, whatever the specificity.
|
|
360
|
+
Leave a token out here and the dark ground is given the light value — for the amber
|
|
361
|
+
ink, #8f4214, that is roughly 1.3:1, which is nothing at all. */
|
|
362
|
+
|
|
363
|
+
.dark [data-brix-theme='kingfisher'] [data-brix-accent='teal'],
|
|
364
|
+
.dark [data-brix-theme='kingfisher'][data-brix-accent='teal'],
|
|
365
|
+
[data-brix-theme='kingfisher'].dark [data-brix-accent='teal'],
|
|
366
|
+
[data-brix-theme='kingfisher'].dark[data-brix-accent='teal'] {
|
|
367
|
+
--primary: #5eead4;
|
|
368
|
+
--ring: #5eead4;
|
|
369
|
+
--primary-on-wash: #5eead4;
|
|
370
|
+
--accent-base: #5eead4;
|
|
371
|
+
--accent-tint: color-mix(in oklab, #5eead4 12%, transparent);
|
|
372
|
+
--accent-head-ink: var(--muted-foreground);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.dark [data-brix-theme='kingfisher'] [data-brix-accent='amber'],
|
|
376
|
+
.dark [data-brix-theme='kingfisher'][data-brix-accent='amber'],
|
|
377
|
+
[data-brix-theme='kingfisher'].dark [data-brix-accent='amber'],
|
|
378
|
+
[data-brix-theme='kingfisher'].dark[data-brix-accent='amber'] {
|
|
379
|
+
--primary: #fb923c;
|
|
380
|
+
--ring: #fb923c;
|
|
381
|
+
--primary-on-wash: #fb923c;
|
|
382
|
+
--accent-base: #fb923c;
|
|
383
|
+
--accent-tint: color-mix(in oklab, #fb923c 12%, transparent);
|
|
384
|
+
--accent-head-ink: var(--muted-foreground);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.dark [data-brix-theme='kingfisher'] [data-brix-accent='indigo'],
|
|
388
|
+
.dark [data-brix-theme='kingfisher'][data-brix-accent='indigo'],
|
|
389
|
+
[data-brix-theme='kingfisher'].dark [data-brix-accent='indigo'],
|
|
390
|
+
[data-brix-theme='kingfisher'].dark[data-brix-accent='indigo'] {
|
|
391
|
+
--primary: #a5b4fc;
|
|
392
|
+
--ring: #a5b4fc;
|
|
393
|
+
--primary-on-wash: #a5b4fc;
|
|
394
|
+
--accent-base: #a5b4fc;
|
|
395
|
+
--accent-tint: color-mix(in oklab, #a5b4fc 12%, transparent);
|
|
396
|
+
--accent-head-ink: var(--muted-foreground);
|
|
397
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/* ---------------------------------------------------------------------------
|
|
2
|
+
noix — the organisation's own: its cyan, #009cb2 in light mode and #00bcd8 in
|
|
3
|
+
dark, on cool near-neutral greys that carry a trace of the same hue. A violet
|
|
4
|
+
is the second accent the ramp asks for; it is the one hue that reads as
|
|
5
|
+
clearly "not the accent" beside a cyan.
|
|
6
|
+
|
|
7
|
+
The two cyans are fixed, and they are accents, not ink: #009cb2 is 3.3:1 on
|
|
8
|
+
white, so the deeper rung #00707f carries anything that has to be read, and
|
|
9
|
+
the bright one stays on bars, dots, rings and fills. The dark mode has the
|
|
10
|
+
opposite problem and no trouble with it: there the bright cyan is the text.
|
|
11
|
+
|
|
12
|
+
Every role in contract.json is bound in both modes. The dark rule carries two
|
|
13
|
+
selectors because the mode class and `data-brix-theme` normally land on the same
|
|
14
|
+
element (the document root), while a preview can put the theme on a subtree
|
|
15
|
+
under a dark page; one block serves both.
|
|
16
|
+
--------------------------------------------------------------------------- */
|
|
17
|
+
|
|
18
|
+
[data-brix-theme='noix'] {
|
|
19
|
+
/* Surfaces and ink: greys with a trace of the accent hue, so the cyan sits on
|
|
20
|
+
them rather than against them. */
|
|
21
|
+
--background: #ffffff;
|
|
22
|
+
--foreground: #0f1c20;
|
|
23
|
+
--card: #ffffff;
|
|
24
|
+
--card-foreground: #0f1c20;
|
|
25
|
+
--popover: #ffffff;
|
|
26
|
+
--popover-foreground: #0f1c20;
|
|
27
|
+
--muted: #f1f6f7;
|
|
28
|
+
--muted-foreground: #5c6b6f;
|
|
29
|
+
--secondary: #f1f6f7;
|
|
30
|
+
--secondary-foreground: #1c2c31;
|
|
31
|
+
--accent: #e7f3f5;
|
|
32
|
+
--accent-foreground: #1c2c31;
|
|
33
|
+
--border: #dde7e9;
|
|
34
|
+
--input: #dde7e9;
|
|
35
|
+
|
|
36
|
+
/* The brand ramp. One ramp serves both modes: application code picks the rung
|
|
37
|
+
per mode (`text-brand dark:text-brand-light`), so the rungs themselves do not
|
|
38
|
+
change when the mode does. --brand and --brand-light are the organisation's
|
|
39
|
+
two cyans exactly; --brand-dark and --brand-deep extend them downwards, which
|
|
40
|
+
is where the readable rungs are. `--brand-ink` is the cool grey of the caps
|
|
41
|
+
field labels on sign-in and account screens, a touch darker than
|
|
42
|
+
--muted-foreground (6.1:1 on the background against 5.5:1) so a 10px label
|
|
43
|
+
still reads.
|
|
44
|
+
|
|
45
|
+
Seven of the eight rungs are identical in the dark block. --brand-ink is the
|
|
46
|
+
exception, and it is the only rung that is ink rather than a hue: there is no
|
|
47
|
+
light/dark pair of it for code to choose between, so this grey would arrive on
|
|
48
|
+
the dark ground at 3.1:1 if it were restated unchanged. */
|
|
49
|
+
--brand: #009cb2;
|
|
50
|
+
--brand-light: #00bcd8;
|
|
51
|
+
--brand-dark: #00707f;
|
|
52
|
+
--brand-deep: #00323a;
|
|
53
|
+
--brand-alt: #5a4fcf;
|
|
54
|
+
--brand-alt-light: #a6a0f0;
|
|
55
|
+
--brand-alt-dark: #42399f;
|
|
56
|
+
--brand-ink: #52666b;
|
|
57
|
+
|
|
58
|
+
/* State. --primary is the deep rung, not the accent itself: it fills buttons and
|
|
59
|
+
draws text, and white on the accent is 3.3:1 where white on this is 5.8:1. The
|
|
60
|
+
accent keeps the focus ring, where nothing has to be read. */
|
|
61
|
+
--primary: var(--brand-dark);
|
|
62
|
+
--primary-foreground: #ffffff;
|
|
63
|
+
--ring: var(--brand);
|
|
64
|
+
/* The primary hue as TEXT on a 10% wash of itself — an active filter chip, and
|
|
65
|
+
anything else that tints its own background. A hue that merely clears WCAG AA
|
|
66
|
+
on the background does not clear it on that wash, so this is a separate token
|
|
67
|
+
rather than --primary; the deep rung clears both and serves as both, at 5.0:1
|
|
68
|
+
on the wash. */
|
|
69
|
+
--primary-on-wash: var(--primary);
|
|
70
|
+
--destructive: #c22d1f;
|
|
71
|
+
--destructive-on-wash: var(--destructive);
|
|
72
|
+
--warning: #b45309;
|
|
73
|
+
--warning-foreground: #ffffff;
|
|
74
|
+
--warning-on-wash: #7c4206;
|
|
75
|
+
/* Success: "saved", "done", "connected". A status colour is meaning, so it is a role
|
|
76
|
+
and not a fixed palette hue. The fill clears 3:1 on --background (it is read as a
|
|
77
|
+
state, WCAG 1.4.11); the ink on the fill and on a 10% wash of it clear 4.5:1. All
|
|
78
|
+
three are in-gamut hex, so none is a boundary clamp. */
|
|
79
|
+
--success: #047857;
|
|
80
|
+
--success-foreground: #ffffff;
|
|
81
|
+
--success-on-wash: #065f46;
|
|
82
|
+
|
|
83
|
+
/* Progress bands (high >= 70, mid >= 30, low below), read as an inline
|
|
84
|
+
`var(--progress-*)` so one inline style serves both modes. Literal values, not
|
|
85
|
+
references: a band hue computed in script is invisible to a grep, so these two
|
|
86
|
+
blocks are the only place one is written down. Light: the deep cyan, the violet
|
|
87
|
+
second accent and a red, each of which also reads as a label (5.8 / 6.1 / 5.7:1
|
|
88
|
+
on the background). */
|
|
89
|
+
--progress-high: #00707f;
|
|
90
|
+
--progress-mid: #5a4fcf;
|
|
91
|
+
--progress-low: #c22d1f;
|
|
92
|
+
|
|
93
|
+
/* Shape and type. A theme only names the family; delivering the webfont stays
|
|
94
|
+
the application's choice (see fonts.css). */
|
|
95
|
+
--radius: 0.75rem;
|
|
96
|
+
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
|
|
97
|
+
--font-heading: var(--font-sans);
|
|
98
|
+
|
|
99
|
+
/* Charts: the two accents and their lighter rungs, with a blue-grey last, so
|
|
100
|
+
series stay apart by lightness as well as by hue. */
|
|
101
|
+
--chart-1: #00707f;
|
|
102
|
+
--chart-2: #009cb2;
|
|
103
|
+
--chart-3: #5a4fcf;
|
|
104
|
+
--chart-4: #8b7fd9;
|
|
105
|
+
--chart-5: #6b8c9b;
|
|
106
|
+
|
|
107
|
+
/* Series roles for charts with several series, read from the document by the
|
|
108
|
+
chart family. One set per mode, shared by every theme: lightness steps of about
|
|
109
|
+
0.10 in OKLab L plus a hue spread, chroma fitted per hue to stay inside sRGB. The
|
|
110
|
+
contrast test holds them 3:1 off --card and 0.09 apart under every vision. */
|
|
111
|
+
--series-1: #460011;
|
|
112
|
+
--series-2: #4d3a05;
|
|
113
|
+
--series-3: #096c45;
|
|
114
|
+
--series-4: #0985b2;
|
|
115
|
+
--series-5: #b575ff;
|
|
116
|
+
|
|
117
|
+
/* Code editor. One syntax set serves every theme and both modes, because the editor
|
|
118
|
+
is a dark surface even under a light page: the surface and ink are this theme's own
|
|
119
|
+
dark card and foreground, restated in both blocks. The gate holds each syntax role
|
|
120
|
+
4.5:1 off --code-surface and 0.08 apart under every vision. --code-selection is
|
|
121
|
+
this theme's --brand-light at 40%. It is bound to that rung rather than to a role,
|
|
122
|
+
because a role follows the mode and this surface does not, and it is written out as
|
|
123
|
+
a literal because the gate reads declared values and cannot parse a color-mix. */
|
|
124
|
+
--syntax-tag: oklch(0.7 0.15 278);
|
|
125
|
+
--syntax-attribute: oklch(0.82 0.16 76);
|
|
126
|
+
--syntax-string: oklch(0.84 0.19 154);
|
|
127
|
+
--syntax-keyword: oklch(0.78 0.1 298);
|
|
128
|
+
--syntax-number: oklch(0.7 0.11 62);
|
|
129
|
+
--syntax-comment: oklch(0.62 0.025 60);
|
|
130
|
+
--syntax-meta: oklch(0.74 0.13 178);
|
|
131
|
+
--syntax-invalid: oklch(0.66 0.27 344);
|
|
132
|
+
--code-surface: #121d21;
|
|
133
|
+
--code-foreground: #e6eef0;
|
|
134
|
+
--code-selection: #00bcd866;
|
|
135
|
+
|
|
136
|
+
--sidebar: #f6fafb;
|
|
137
|
+
--sidebar-foreground: #0f1c20;
|
|
138
|
+
--sidebar-primary: #00707f;
|
|
139
|
+
--sidebar-primary-foreground: #ffffff;
|
|
140
|
+
--sidebar-accent: #e7f3f5;
|
|
141
|
+
--sidebar-accent-foreground: #1c2c31;
|
|
142
|
+
--sidebar-border: #dde7e9;
|
|
143
|
+
--sidebar-ring: #009cb2;
|
|
144
|
+
|
|
145
|
+
/* Neutral fallback for everything outside an accent set, so the accent utilities
|
|
146
|
+
resolve on a page that sets no [data-brix-accent]. This theme ships no accent sets:
|
|
147
|
+
a theme may leave them out, and these two are then what the utilities read.
|
|
148
|
+
--accent-base is the organisation's cyan itself — it is a bar and a dot here,
|
|
149
|
+
never text. */
|
|
150
|
+
--accent-base: var(--brand);
|
|
151
|
+
--accent-tint: #e6f5f7;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.dark [data-brix-theme='noix'],
|
|
155
|
+
[data-brix-theme='noix'].dark {
|
|
156
|
+
--background: #0b1316;
|
|
157
|
+
--foreground: #e6eef0;
|
|
158
|
+
--card: #121d21;
|
|
159
|
+
--card-foreground: #e6eef0;
|
|
160
|
+
--popover: #121d21;
|
|
161
|
+
--popover-foreground: #e6eef0;
|
|
162
|
+
--muted: #1b2a2f;
|
|
163
|
+
--muted-foreground: #9db0b5;
|
|
164
|
+
--secondary: #1b2a2f;
|
|
165
|
+
--secondary-foreground: #e6eef0;
|
|
166
|
+
--accent: #1f3137;
|
|
167
|
+
--accent-foreground: #e6eef0;
|
|
168
|
+
--border: #243a40;
|
|
169
|
+
--input: #2b444b;
|
|
170
|
+
|
|
171
|
+
/* The ramp is restated, not inherited: the light rule matches this same element
|
|
172
|
+
and its declarations would beat anything inherited from an ancestor. Same
|
|
173
|
+
rungs, same values — what changes in dark mode is which rung a utility picks. */
|
|
174
|
+
--brand: #009cb2;
|
|
175
|
+
--brand-light: #00bcd8;
|
|
176
|
+
--brand-dark: #00707f;
|
|
177
|
+
--brand-deep: #00323a;
|
|
178
|
+
--brand-alt: #5a4fcf;
|
|
179
|
+
--brand-alt-light: #a6a0f0;
|
|
180
|
+
--brand-alt-dark: #42399f;
|
|
181
|
+
/* The one rung that changes with the mode, because it is the one rung that is
|
|
182
|
+
ink: the light grey at 11.0:1, where the light block's 6.1:1 grey would have
|
|
183
|
+
arrived here at 3.1:1. It stays a step clearer than --muted-foreground (8.3:1),
|
|
184
|
+
which is what it is for. */
|
|
185
|
+
--brand-ink: #b7c9ce;
|
|
186
|
+
|
|
187
|
+
/* On the dark ground the bright cyan is the readable one, and the deep rung
|
|
188
|
+
becomes the ink on top of it, at 6.1:1. */
|
|
189
|
+
--primary: var(--brand-light);
|
|
190
|
+
--primary-foreground: var(--brand-deep);
|
|
191
|
+
--ring: var(--brand-light);
|
|
192
|
+
/* The wash darkens nothing the text has to fight here: the bright cyan stands as
|
|
193
|
+
it is on a 10% wash of itself, at 7.1:1. */
|
|
194
|
+
--primary-on-wash: var(--brand-light);
|
|
195
|
+
--destructive: #f08679;
|
|
196
|
+
--destructive-on-wash: var(--destructive);
|
|
197
|
+
--warning: #f0b429;
|
|
198
|
+
--warning-foreground: #1a1205;
|
|
199
|
+
--warning-on-wash: #fbbf24;
|
|
200
|
+
/* Light rung on a dark ground, like the warning family. The ink on the fill is the
|
|
201
|
+
deepest emerald rather than black, so the pair reads as one hue. */
|
|
202
|
+
--success: #34d399;
|
|
203
|
+
--success-foreground: #052e1f;
|
|
204
|
+
--success-on-wash: #6ee7b7;
|
|
205
|
+
|
|
206
|
+
/* The light bands do not survive the dark ground (3.2 / 3.1 / 3.3:1 on it), so
|
|
207
|
+
each is lightened: the bright cyan, the light violet and a light red. Measured
|
|
208
|
+
against --background / --card / --muted (the bar track and a hovered row):
|
|
209
|
+
8.2 / 7.5 / 6.5, 8.0 / 7.3 / 6.3 and 7.5 / 6.9 / 5.9. */
|
|
210
|
+
--progress-high: #00bcd8;
|
|
211
|
+
--progress-mid: #a6a0f0;
|
|
212
|
+
--progress-low: #f08679;
|
|
213
|
+
|
|
214
|
+
--radius: 0.75rem;
|
|
215
|
+
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
|
|
216
|
+
--font-heading: var(--font-sans);
|
|
217
|
+
|
|
218
|
+
/* The chart ramp is lightened for the dark ground: the deep cyan and the deep
|
|
219
|
+
violet of the light ramp would have been invisible here. */
|
|
220
|
+
--chart-1: #00bcd8;
|
|
221
|
+
--chart-2: #5fd3e6;
|
|
222
|
+
--chart-3: #a6a0f0;
|
|
223
|
+
--chart-4: #cac6f8;
|
|
224
|
+
--chart-5: #9db0b5;
|
|
225
|
+
|
|
226
|
+
/* Series roles for charts with several series, read from the document by the
|
|
227
|
+
chart family. One set per mode, shared by every theme: lightness steps of about
|
|
228
|
+
0.10 in OKLab L plus a hue spread, chroma fitted per hue to stay inside sRGB. The
|
|
229
|
+
contrast test holds them 3:1 off --card and 0.09 apart under every vision. */
|
|
230
|
+
--series-1: #916748;
|
|
231
|
+
--series-2: #82986a;
|
|
232
|
+
--series-3: #77bcc0;
|
|
233
|
+
--series-4: #becbfc;
|
|
234
|
+
--series-5: #fee7f3;
|
|
235
|
+
|
|
236
|
+
/* Code editor. One syntax set serves every theme and both modes, because the editor
|
|
237
|
+
is a dark surface even under a light page: the surface and ink are this theme's own
|
|
238
|
+
dark card and foreground, restated in both blocks. The gate holds each syntax role
|
|
239
|
+
4.5:1 off --code-surface and 0.08 apart under every vision. --code-selection is
|
|
240
|
+
this theme's --brand-light at 40%. It is bound to that rung rather than to a role,
|
|
241
|
+
because a role follows the mode and this surface does not, and it is written out as
|
|
242
|
+
a literal because the gate reads declared values and cannot parse a color-mix. */
|
|
243
|
+
--syntax-tag: oklch(0.7 0.15 278);
|
|
244
|
+
--syntax-attribute: oklch(0.82 0.16 76);
|
|
245
|
+
--syntax-string: oklch(0.84 0.19 154);
|
|
246
|
+
--syntax-keyword: oklch(0.78 0.1 298);
|
|
247
|
+
--syntax-number: oklch(0.7 0.11 62);
|
|
248
|
+
--syntax-comment: oklch(0.62 0.025 60);
|
|
249
|
+
--syntax-meta: oklch(0.74 0.13 178);
|
|
250
|
+
--syntax-invalid: oklch(0.66 0.27 344);
|
|
251
|
+
--code-surface: #121d21;
|
|
252
|
+
--code-foreground: #e6eef0;
|
|
253
|
+
--code-selection: #00bcd866;
|
|
254
|
+
|
|
255
|
+
--sidebar: #121d21;
|
|
256
|
+
--sidebar-foreground: #e6eef0;
|
|
257
|
+
--sidebar-primary: #00bcd8;
|
|
258
|
+
--sidebar-primary-foreground: #00323a;
|
|
259
|
+
--sidebar-accent: #1b2a2f;
|
|
260
|
+
--sidebar-accent-foreground: #e6eef0;
|
|
261
|
+
--sidebar-border: #243a40;
|
|
262
|
+
--sidebar-ring: #009cb2;
|
|
263
|
+
|
|
264
|
+
--accent-base: var(--brand-light);
|
|
265
|
+
--accent-tint: #0a2429;
|
|
266
|
+
}
|