@bsuite/theme 0.10.2 → 0.10.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsuite/theme",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -101,3 +101,44 @@
101
101
  transition-duration: 0.01ms !important;
102
102
  }
103
103
  }
104
+
105
+ /* ============================================================
106
+ GRADIENT TEXT — the display-heading treatment
107
+ ============================================================
108
+ Operator ruling 2026-08-04: a page TITLE carries the accent gradient, on
109
+ authenticated surfaces too. That widens the `.bsuite-accent-gradient` note
110
+ above, which restricted the gradient to marketing/pre-auth heroes — the ban
111
+ it was really protecting is on FUNCTIONAL text (labels, body copy, values,
112
+ anything you read to make a decision), and a page title is none of those.
113
+
114
+ Uses --gradient-heading, NOT --gradient-accent. The raw accent gradient ends
115
+ in cyan at 1.76:1 on the light background, which would leave half the word
116
+ unreadable; --gradient-heading is built from the AA-verified *-text variants
117
+ and is correct in both modes. See the token for the measurements.
118
+
119
+ background-clip: text requires `color: transparent`, so a gradient that fails
120
+ to resolve produces INVISIBLE text rather than an ugly one. Both stops
121
+ therefore come from tokens the package itself defines. */
122
+ .text-gradient-accent {
123
+ background-image: var(--gradient-heading);
124
+ -webkit-background-clip: text;
125
+ background-clip: text;
126
+ color: transparent;
127
+ /* SHRINK-WRAP, and this is the whole reason the effect is visible.
128
+ background-clip: text paints the gradient across the ELEMENT BOX, not the
129
+ glyphs. A block-level h1 spans its container, so a short word samples only
130
+ the first ~15% of the gradient and the far stop never reaches the screen —
131
+ it renders as a flat colour, which is indistinguishable from the bug this
132
+ replaces. fit-content makes the box hug the text so the gradient spans the
133
+ letters. */
134
+ width: fit-content;
135
+ /* A gradient heading must still be selectable and searchable. background-clip
136
+ keeps the real glyphs, so text selection, find-in-page and screen readers
137
+ are unaffected — do not reach for an SVG or an image here. */
138
+ }
139
+
140
+ /* Forced-colours mode drops background-image entirely, which would leave
141
+ transparent glyphs on screen. Hand the text back to the system palette. */
142
+ @media (forced-colors: active) {
143
+ .text-gradient-accent { background-image: none; color: CanvasText; }
144
+ }
package/src/css/vars.css CHANGED
@@ -206,6 +206,9 @@
206
206
  --role-error-text: oklch(0.556 0.230 25); /* 4.69:1 ✓ AA */
207
207
  --role-warning-text: oklch(0.535 0.150 75); /* 4.70:1 ✓ AA */
208
208
  --role-success-text: oklch(0.501 0.130 195); /* 4.70:1 ✓ AA */
209
+ /* Pair for --role-info. Every other semantic role had a -text token; info
210
+ was the only gap, which forced apps to invent a local copy (R80.4). */
211
+ --role-info-text: oklch(0.480 0.120 192); /* 4.70:1 ✓ AA on panel */
209
212
 
210
213
  /* Text roles — six-tier scale (W3 §3.1 contract). Every tier below is
211
214
  measured against --role-bg-body (the conservative floor); all tiers
@@ -314,6 +317,20 @@
314
317
  ============================================================ */
315
318
  --gradient-accent: linear-gradient(135deg, var(--role-primary), var(--role-accent));
316
319
 
320
+ /* HEADING gradient — the same two hues, but built from the *-text role
321
+ variants rather than the raw ones, and that difference is load-bearing.
322
+ Measured against the mode backgrounds:
323
+
324
+ --role-accent (cyan) on the LIGHT bg ......... 1.76:1 unreadable
325
+ --role-accent-text on the LIGHT bg ......... 4.70:1 AA
326
+
327
+ So painting a heading with --gradient-accent verbatim leaves the cyan half
328
+ of the word illegible in light mode. The *-text variants are AA-verified in
329
+ BOTH modes and already flip under .dark, so one token is correct in both:
330
+ light 4.71:1 -> 4.70:1 dark 7.01:1 -> 9.78:1
331
+ No new colour values, so the palette whitelist is unaffected. */
332
+ --gradient-heading: linear-gradient(135deg, var(--role-primary-text), var(--role-accent-text));
333
+
317
334
  /* ============================================================
318
335
  GLOW + SHADOW MULTIPLIERS
319
336
  ============================================================ */
@@ -458,6 +475,7 @@
458
475
  --role-error-text: oklch(0.786 0.230 25); /* 7.00:1 ✓ AAA */
459
476
  --role-warning-text: var(--neon-electric-amber);/* 10.10:1 ✓ AAA */
460
477
  --role-success-text: oklch(0.671 0.130 195); /* 6.99:1 ✓ AAA */
478
+ --role-info-text: oklch(0.780 0.120 192); /* 7.0:1 ✓ AAA on dark panel */
461
479
 
462
480
  /* Glow/shadow scale up in dark mode */
463
481
  --glow-strength: 0.6;
package/src/preset-v4.css CHANGED
@@ -101,6 +101,7 @@
101
101
  --color-error-text: var(--role-error-text);
102
102
  --color-warning-text: var(--role-warning-text);
103
103
  --color-success-text: var(--role-success-text);
104
+ --color-info-text: var(--role-info-text);
104
105
 
105
106
  /* Informational scale — CATEGORICAL, never state. `bg-info-3`, `text-info-5`.
106
107
  Numbered because they are interchangeable slots with no meaning of their