@bsuite/theme 0.10.3 → 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.3",
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
@@ -317,6 +317,20 @@
317
317
  ============================================================ */
318
318
  --gradient-accent: linear-gradient(135deg, var(--role-primary), var(--role-accent));
319
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
+
320
334
  /* ============================================================
321
335
  GLOW + SHADOW MULTIPLIERS
322
336
  ============================================================ */