@bsuite/theme 0.7.0 → 0.7.1
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/package.json +1 -1
- package/src/css/vars.css +30 -0
- package/src/preset-v4.css +5 -0
package/package.json
CHANGED
package/src/css/vars.css
CHANGED
|
@@ -154,6 +154,32 @@
|
|
|
154
154
|
--role-border: var(--light-border);
|
|
155
155
|
--role-border-strong: oklch(0.880 0.008 250);
|
|
156
156
|
|
|
157
|
+
/* Scrim — the veil behind a modal, and the reason `bg-black/N` survived
|
|
158
|
+
everywhere else. It was the single most duplicated pure endpoint in the
|
|
159
|
+
tree (9 sites across nav-core, page-builder and schema-builder) for one
|
|
160
|
+
reason: no overlay role existed, so every author reached for the only
|
|
161
|
+
thing that was always available. A banned value with no sanctioned
|
|
162
|
+
replacement does not get obeyed, it gets re-typed.
|
|
163
|
+
|
|
164
|
+
VALUE AND SHAPE ADOPTED FROM crm7, which had already solved this locally
|
|
165
|
+
(crm7/src/index.css --color-overlay, with the note "pure black banned").
|
|
166
|
+
Lifting their value rather than minting a competing one is the whole
|
|
167
|
+
point: two scrim tokens with different values is the duplication this
|
|
168
|
+
change exists to remove, and theirs was here first.
|
|
169
|
+
|
|
170
|
+
OPAQUE — the alpha belongs at the CALL SITE, not in the token. I first
|
|
171
|
+
baked 0.55 in to stop the /40-vs-/50 drift between page-builder and
|
|
172
|
+
schema-builder, which would have silently halved crm7's existing
|
|
173
|
+
`bg-overlay/50` to 0.275 by compounding. Call-site alpha is also simply
|
|
174
|
+
more useful: a full-page modal scrim and a caption strip over a photo
|
|
175
|
+
want the same colour at different strengths.
|
|
176
|
+
|
|
177
|
+
Declared ONCE — no .dark override. A scrim is not a surface: it veils
|
|
178
|
+
whatever is behind it, and the dialog above it is --role-bg-panel, which
|
|
179
|
+
already flips. Giving it a dark twin would move the veil and the panel
|
|
180
|
+
together and cancel out the separation this exists to create. */
|
|
181
|
+
--role-overlay: oklch(0.145 0.022 268);
|
|
182
|
+
|
|
157
183
|
/* Inverse text on coloured fills. Two values only — the fill is either
|
|
158
184
|
light enough to need dark text, or dark enough to need light text.
|
|
159
185
|
Neither is a pure endpoint. */
|
|
@@ -162,6 +188,10 @@
|
|
|
162
188
|
--text-on-primary: var(--text-on-light-fill); /* on blue L≈0.55 — 4.88:1 ✓ AA */
|
|
163
189
|
--text-on-error: var(--text-on-light-fill); /* on red L≈0.58 — 4.55:1 ✓ AA */
|
|
164
190
|
--text-on-accent: var(--text-on-dark-fill); /* on cyan L≈0.77 — 9.38:1 ✓ AAA */
|
|
191
|
+
--text-on-overlay: var(--text-on-light-fill); /* on scrim L≈0.15 — the scrim is dark in BOTH modes,
|
|
192
|
+
so this never flips. crm7 declared it as a bare
|
|
193
|
+
oklch(0.99 0 0); routed through the shared token
|
|
194
|
+
instead so there is one near-white, not two. */
|
|
165
195
|
--text-on-warning: var(--text-on-dark-fill); /* on amber L≈0.80 — 9.68:1 ✓ AAA */
|
|
166
196
|
--text-on-success: var(--text-on-dark-fill); /* on teal L≈0.60 — 5.17:1 ✓ AA */
|
|
167
197
|
|
package/src/preset-v4.css
CHANGED
|
@@ -129,6 +129,11 @@
|
|
|
129
129
|
--color-border: var(--role-border);
|
|
130
130
|
--color-input: var(--role-border);
|
|
131
131
|
--color-ring: var(--role-primary);
|
|
132
|
+
/* Modal scrim. OPAQUE — always write an explicit alpha at the call site
|
|
133
|
+
(`bg-overlay/50`), never bare `bg-overlay`, which would hide the page
|
|
134
|
+
entirely. Pairs with `text-text-on-overlay`. */
|
|
135
|
+
--color-overlay: var(--role-overlay);
|
|
136
|
+
--color-text-on-overlay: var(--text-on-overlay);
|
|
132
137
|
|
|
133
138
|
/* ============================================================
|
|
134
139
|
LAYER 5 — Inverse text on coloured fills
|