-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.css
More file actions
70 lines (64 loc) · 3.13 KB
/
Copy pathtailwind.css
File metadata and controls
70 lines (64 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* Tailwind v4 + daisyUI 5 input — build with `npm run build:css`.
Output (public/assets/styles.css) is committed, like the generated seed
migration, so deploy stays a plain `wrangler deploy`. */
@import "tailwindcss" source(none);
/* The scan list is the fuel-mix chart page and nothing else — it is an
ALLOW-LIST on purpose, not a directory scan.
public/assets/styles.css is downloaded by every page here, so a bare
`@source "./public"` means a class used only on the station map still grows
the bytes the chart page pays for (LAB-1702 measured +9 kB before this
change: daisyUI's .list/.input/.hero pulled in by nothing more than the word
"ring" appearing in a loop variable). The map page brings its own
hand-written public/assets/map.css and reuses only the daisyUI components
this list already emits.
TWO RULES FALL OUT OF THIS, both silent if broken:
1. ADDING A FILE TO THE CHART PAGE MEANS ADDING IT HERE, or its classes go
missing at runtime with no build error.
2. public/map.html and public/map.js are deliberately NOT scanned, so they
may use only classes this list already emits — every other map-only rule
belongs in public/assets/map.css. Deleting a class from index.html can
therefore unstyle the map page while CI stays green.
`npm run check:classes` enforces rule 2 and runs in CI.
Also worth knowing: the scanner reads PROSE, not just markup. A comment in a
scanned file containing the bare word "grow" emits `.grow{flex-grow:1}`. If
the stylesheet grows by a few bytes for no visible reason, that is why. */
@source "./public/index.html";
@source "./public/app.js";
@source "./public/chrome.js";
@source "./public/stacking.js";
@source "./public/overlays.js";
@source "./public/ranges.js";
@plugin "daisyui" {
themes: light --default, dark --prefersdark;
}
/* Chart surface + chrome tokens, pinned to the exact hexes the fuel palette
was validated against (dataviz six-checks validator; see app.js). The card
backgrounds use these literals rather than daisyUI base-100 so a future
daisyUI theme tweak can't silently invalidate the palette's contrast run. */
/* --chart-intensity-ink is the carbon-intensity overlay (LAB-1698). It is
deliberately ACHROMATIC and at the lightness extreme: every fuel fill is
chromatic and mid-lightness, and the palette's own CVD mechanism is
lightness separation (protanopia collapses hue, L survives), so an
ink-black/paper-white line cannot be confused with any band under any
simulation. It is also a line on a second axis, not another area — a
different kind of quantity should not compete for a hue slot. */
:root,
[data-theme="light"] {
--chart-surface: #ffffff;
--chart-grid: #e1e0d9;
--chart-axis-ink: #898781;
--chart-intensity-ink: #17150f;
}
[data-theme="dark"] {
--chart-surface: #1d232a;
--chart-grid: #2c2c2a;
--chart-axis-ink: #898781;
--chart-intensity-ink: #f4f1e8;
}
.chart-surface {
background-color: var(--chart-surface);
}
/* uPlot chrome: recessive hairline grid, muted axis ink (dataviz mark specs). */
.u-legend {
display: none; /* custom readout panel replaces the built-in legend */
}