@jungherz-de/glasskit 1.30.0 → 1.31.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/CHANGELOG.md +23 -1
- package/README.md +17 -8
- package/SKILL.md +11 -4
- package/glasskit-styles.js +3 -3
- package/glasskit.css +73 -18
- package/glasskit.min.css +2 -2
- package/glasskit.min.css.map +1 -1
- package/package.json +1 -1
- package/theme-override.css +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ GlassKit uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.31.0] – 2026-10-25
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Hooks of the button's own: `--gl-btn-radius`.** `.glass-btn` took its corners from `--gl-radius-btn`, which `.glass-list`, `.glass-status`, `.glass-toast`, `.glass-accordion__item` and `.glass-segmented` share, so a project that wanted pill-shaped buttons turned lists, toasts and the segmented control into capsules as well; the height had a hook of its own, the radius none. `--gl-btn-radius` rounds the buttons alone, unset `--gl-radius-btn`; `--sm` reads `--gl-btn-radius-sm`, then `--gl-btn-radius`, and keeps its 12px while neither is set. The issue proposed the small size falling back to `--gl-radius-sm` directly; through `--gl-btn-radius` one value shapes every size, which an app builder that lets each app choose the shape of its buttons needs. Measured in Chromium 153, WebKit 26.6 and Firefox 151 with the issue's page: with `--gl-btn-radius: 9999px` on `:root` the buttons are round, while the list, the segmented control, the status card, the toast and the accordion item stay at 16px; `--gl-btn-radius-sm: 4px` changes the small buttons alone. ([#20](https://github.com/JUNGHERZ/GlassKit/issues/20))
|
|
15
|
+
- **Room beside the label for every button: `--gl-btn-padding-x`.** Only `--auto` had a horizontal padding, 24px; every other button kept the browser's, 6px in Chromium and WebKit and 4px in Firefox. A small button whose width came from its text — in a row of actions, in an empty state, a GlassKit Elements `<glk-button size="sm">` in a flex row — touched the text with its edges, pill-shaped ones even more visibly. Every button now has `padding-inline: var(--gl-btn-padding-x, 24px)`, the padding of `--auto`, and `--sm` reads `--gl-btn-padding-x-sm` first. The vertical padding stays as it was, so a full-width button keeps its label where it was and an `--auto` button its width to the tenth of a pixel. The issue proposed 0 as the default with values of their own for `--sm` and `--auto`; one value for every size keeps `--sm --auto` buttons — the image picker's, the empty state's — as they were, and a small button in a row now looks like one of them. Measured with the issue's page: the text of the small button starts 25px from its edge, before 7px (Firefox 5px). ([#22](https://github.com/JUNGHERZ/GlassKit/issues/22))
|
|
16
|
+
- **A colour of the count's own in the segmented control: `.glass-segmented__badge--primary`, `--success`, `--warning`, `--error`**, and tokens for its size and hairline. The count could be coloured only through the option's tone, which also puts the dot before the label, or through its three colour tokens; its height (16px), its font size (11px) and the missing hairline were fixed. So a red count of new calls on an "Open" option without a dot, or a count as large as a `.glass-badge`, could not be had. The four classes give the count the look of the badge variants — the state tint over a doubled scrim, a hairline in the state colour, the readable text colour — without the dot; where the option has a tone too, the count's own colour wins. `--gl-segmented-badge-height` (16px, also its least width), `--gl-segmented-badge-font-size` (11px) and `--gl-segmented-badge-border` (a colour, drawn inside the neutral count, unset none) size and outline it. Measured in all three engines, the four colours reach 4.71:1 or more in both themes, inline, under the drop and at the icon's corner, on the chosen option and beside it; the new `--primary` 4.79:1 in the light theme and 5.10:1 in the dark one. ([#21](https://github.com/JUNGHERZ/GlassKit/issues/21))
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **Muted text, card text and icons reach WCAG AA by default.** In the light theme `--gl-color-text-muted` read 3.41:1 on the page and 3.47:1 on glass, `--gl-card-text-color` 4.00:1 and `--gl-icon-muted` 2.05:1 — below the 4.5:1 text needs and the 3:1 of icons that carry a meaning; in the dark theme muted text read 4.45:1 on glass. Light: muted text 55 → 68 %, card text 60 → 68 %, icons muted 35 → 55 %, default 50 → 65 %, strong 70 → 80 % (the card icon and the tertiary icon follow the default), so the three steps keep their order; dark: muted text 60 → 65 %. The select's chevron follows the muted text in both. Measured with the issue's page in Chromium 153, WebKit 26.6 and Firefox 151: in the light theme muted text 4.97:1 on the page and 5.09:1 on glass, card text 5.09:1, icons 3.41, 4.54 and 7.23:1; in the dark theme muted text 5.88:1 and 4.92:1. Two points of the issue were decided otherwise. `--gl-color-primary-text` stays the primary: GlassKit's light orange reads 2.43:1 as text, but a fixed mix with black would darken every brand alike and a darker one far more than it needs, a pink at 4.33:1 to 8.79:1; docs, README and SKILL.md show the recipe for a light theme that keeps the orange (`--gl-color-primary-on-surface`, 5.8:1). White on the primary button stays part of the look, as decided in 1.7.0 (2.68:1 light, 2.03:1 dark on the lightest stop of the gradient); the docs now show the dark ink as well, 4.6:1 or more on every stop. ([#19](https://github.com/JUNGHERZ/GlassKit/issues/19))
|
|
21
|
+
|
|
22
|
+
### Compatibility
|
|
23
|
+
|
|
24
|
+
- Small buttons that take their width from their text grow by 36px: in the docs and the showcase of GlassKit Elements "Small" from 51 to 87px and "Book" from 48 to 84px, and a row of three that fit the showcase's narrow column in one line now breaks into two. Plain markup changes only where a container shrinks a `.glass-btn` without `--auto` to its text. `--gl-btn-padding-x-sm` or `--gl-btn-padding-x` set another value.
|
|
25
|
+
- The light theme reads firmer: muted text, card text and icons are darker; in the dark theme muted text is a little brighter. A page that copies GlassKit's light tokens — the no-JS `prefers-color-scheme` mirror of GlassKit Web — updates its copies of these seven tokens and the chevron.
|
|
26
|
+
|
|
27
|
+
Docs (English and German), README, SKILL.md and `theme-override.css` describe the hooks, the colours of the count and the contrast. With the raised tokens and the chevron set back to their 1.30.0 values, docs, showcase and landing pages render pixel-identical to 1.30.0 in Chromium 153, WebKit 26.6 and Firefox 151 — in Chromium section by section, where full-page captures differ by rasterisation — apart from the new docs example of the coloured count.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
10
31
|
## [1.30.0] – 2026-10-22
|
|
11
32
|
|
|
12
33
|
### Added
|
|
@@ -1198,6 +1219,7 @@ during development. Version 1.3 is the first public open-source release.
|
|
|
1198
1219
|
|
|
1199
1220
|
---
|
|
1200
1221
|
|
|
1222
|
+
[1.31.0]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.31.0
|
|
1201
1223
|
[1.30.0]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.30.0
|
|
1202
1224
|
[1.29.1]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.29.1
|
|
1203
1225
|
[1.29.0]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.29.0
|
|
@@ -1241,4 +1263,4 @@ during development. Version 1.3 is the first public open-source release.
|
|
|
1241
1263
|
[1.3.2]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.3.2
|
|
1242
1264
|
[1.3.1]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.3.1
|
|
1243
1265
|
[1.3.0]: https://github.com/JUNGHERZ/GlassKit/releases/tag/v1.3.0
|
|
1244
|
-
[Unreleased]: https://github.com/JUNGHERZ/GlassKit/compare/v1.
|
|
1266
|
+
[Unreleased]: https://github.com/JUNGHERZ/GlassKit/compare/v1.31.0...HEAD
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-1.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-1.31.0-orange?style=flat-square" alt="Version">
|
|
3
3
|
<img src="https://img.shields.io/badge/CSS-only-blue?style=flat-square" alt="CSS only">
|
|
4
4
|
<img src="https://img.shields.io/badge/components-34-green?style=flat-square" alt="Components">
|
|
5
5
|
<img src="https://img.shields.io/badge/license-MIT-lightgrey?style=flat-square" alt="License">
|
|
6
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.
|
|
6
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.31.0-f5a623?style=flat-square" alt="Changelog"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@jungherz-de/glasskit"><img src="https://img.shields.io/npm/v/@jungherz-de/glasskit?style=flat-square&color=cb3837&label=npm" alt="npm"></a>
|
|
8
8
|
<a href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit/"><img src="https://img.shields.io/badge/CDN-jsDelivr-blue?style=flat-square" alt="jsDelivr"></a>
|
|
9
9
|
</p>
|
|
@@ -73,22 +73,22 @@ No download, no build tool – just include and go:
|
|
|
73
73
|
|
|
74
74
|
```html
|
|
75
75
|
<!-- jsDelivr – Minified -->
|
|
76
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.
|
|
76
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.31/glasskit.min.css">
|
|
77
77
|
|
|
78
78
|
<!-- jsDelivr – Unminified (for reading/debugging) -->
|
|
79
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.
|
|
79
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.31/glasskit.css">
|
|
80
80
|
|
|
81
81
|
<!-- unpkg – Alternative -->
|
|
82
|
-
<link rel="stylesheet" href="https://unpkg.com/@jungherz-de/glasskit@1.
|
|
82
|
+
<link rel="stylesheet" href="https://unpkg.com/@jungherz-de/glasskit@1.31/glasskit.min.css">
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
> **Tip:** Replace `@1.
|
|
85
|
+
> **Tip:** Replace `@1.31` with `@latest` for the newest version – or pin to a specific version for maximum stability.
|
|
86
86
|
|
|
87
87
|
The [droplet](#-droplet-a-fluid-selection) takes one optional module next to the stylesheet:
|
|
88
88
|
|
|
89
89
|
```html
|
|
90
90
|
<script type="module">
|
|
91
|
-
import { attachDroplets } from 'https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.
|
|
91
|
+
import { attachDroplets } from 'https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.31/glasskit-droplet.js';
|
|
92
92
|
attachDroplets();
|
|
93
93
|
</script>
|
|
94
94
|
```
|
|
@@ -322,6 +322,8 @@ a later declaration if you want to bend one.
|
|
|
322
322
|
|
|
323
323
|
`--gl-tab-bar-active-color` colours the icon and label of the active tab alone, for a spotlight that needs a lighter tone still; unset, they take `--gl-color-primary-text`.
|
|
324
324
|
|
|
325
|
+
**Contrast (since 1.31.0).** Muted text, card text and icons reach WCAG AA by default in both themes — text 4.5:1, icons with a meaning 3:1, on the page and on glass. The primary as text keeps the primary: GlassKit's light orange reads 2.43:1 as text, but a fixed mix would darken every brand alike, so a light theme that keeps the orange sets `[data-theme="light"] { --gl-color-primary-text: var(--gl-color-primary-on-surface); }` (5.8:1). White on the primary button stays part of the look; `--gl-color-on-primary: color-mix(in srgb, var(--gl-color-primary) 17%, #000)` switches it to a dark ink with 4.6:1 or more.
|
|
326
|
+
|
|
325
327
|
The `theme-override.css` template comes with **4 example themes**:
|
|
326
328
|
- 🔵 Ocean Blue
|
|
327
329
|
- 🟢 Emerald Green
|
|
@@ -459,6 +461,10 @@ All visual values are controlled via CSS Custom Properties:
|
|
|
459
461
|
|
|
460
462
|
/* Component hooks */
|
|
461
463
|
--gl-modal-max-width /* 340px */
|
|
464
|
+
--gl-btn-radius /* buttons alone; unset: --gl-radius-btn, shared with lists, toasts, the segmented control */
|
|
465
|
+
--gl-btn-radius-sm /* --sm; unset: --gl-btn-radius, then --gl-radius-sm */
|
|
466
|
+
--gl-btn-padding-x /* room beside the label; unset: 24px */
|
|
467
|
+
--gl-btn-padding-x-sm /* --sm; unset: --gl-btn-padding-x */
|
|
462
468
|
--gl-select-chevron /* url(…) per theme */
|
|
463
469
|
--gl-toast-top /* distance of the toast from the top */
|
|
464
470
|
--gl-input-prefix-size /* room for an input prefix, 18px */
|
|
@@ -487,6 +493,9 @@ All visual values are controlled via CSS Custom Properties:
|
|
|
487
493
|
--gl-segmented-active-color /* label and icon of the chosen option; unset: --gl-color-text-heading */
|
|
488
494
|
--gl-segmented-badge-bg /* tint of a neutral count over the state scrim; unset: 12 % of the text colour */
|
|
489
495
|
--gl-segmented-badge-color /* its figures; unset: --gl-color-text */
|
|
496
|
+
--gl-segmented-badge-height /* 16px, also its least width */
|
|
497
|
+
--gl-segmented-badge-font-size /* 11px */
|
|
498
|
+
--gl-segmented-badge-border /* hairline inside a neutral count; unset: none */
|
|
490
499
|
--gl-list-flush-inset /* how far a --flush list reaches out; set by the card and the modal body, else 20px */
|
|
491
500
|
--gl-gloss-droplet /* highlight in the drop of --droplet rows; off with data-surface */
|
|
492
501
|
```
|
|
@@ -790,7 +799,7 @@ Prose:
|
|
|
790
799
|
.glass-prose (styles the rendered content beneath it)
|
|
791
800
|
|
|
792
801
|
Segmented:
|
|
793
|
-
.glass-segmented--full / --scroll / --wrap / --icons · __item[aria-pressed] · __item--success / --warning / --error · __dot · __icon · __badge
|
|
802
|
+
.glass-segmented--full / --scroll / --wrap / --icons · __item[aria-pressed] · __item--success / --warning / --error · __dot · __icon · __badge (--primary / --success / --warning / --error)
|
|
794
803
|
.glass-segmented--droplet (gliding selection, with glasskit-droplet.js)
|
|
795
804
|
|
|
796
805
|
Steps:
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: glasskit-css
|
|
3
|
-
description: GlassKit is a pure CSS glassmorphism component library (v1.
|
|
3
|
+
description: GlassKit is a pure CSS glassmorphism component library (v1.31.0) with 34 components, Dark & Light mode, design tokens, and BEM-like naming. Use this reference whenever generating HTML that uses GlassKit classes to ensure correct structure, nesting, modifiers, and token usage.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GlassKit CSS – AI Component Reference
|
|
@@ -148,7 +148,7 @@ All visual values are controlled via CSS Custom Properties. For custom theming,
|
|
|
148
148
|
| `--gl-color-primary-dark` | `#d4692a` | `#c96a1e` | Gradient end value |
|
|
149
149
|
| `--gl-color-primary-mid` | derived → `#e07a24` | derived → `#d97826` | Gradient midpoint, mixed from primary + primary-dark |
|
|
150
150
|
| `--gl-color-text` | `#ffffff` | `#1a2a36` | Default text color |
|
|
151
|
-
| `--gl-color-text-muted` | `rgba(255,255,255,0.
|
|
151
|
+
| `--gl-color-text-muted` | `rgba(255,255,255,0.65)` | `rgba(26,42,54,0.68)` | Secondary text — 4.5:1 on the page and on glass since 1.31.0 (before 60 % / 55 %) |
|
|
152
152
|
| `--gl-color-text-heading` | `#ffffff` | `#0f1f2a` | Headings |
|
|
153
153
|
| `--gl-color-success` | `#34c759` | `#28a745` | Success |
|
|
154
154
|
| `--gl-color-error` | `#ff3b30` | `#dc3545` | Error |
|
|
@@ -198,6 +198,8 @@ fully-translucent pre-1.7.0 chip.
|
|
|
198
198
|
>
|
|
199
199
|
> That reaches 4,62:1. Badges are unaffected — they already pass by default.
|
|
200
200
|
|
|
201
|
+
> **AA by default since 1.31.0** for muted text (`--gl-color-text-muted` 65 % dark / 68 % light), card text (68 % light) and icons (light: muted 55 %, default 65 %, strong 80 %) — text 4.5:1, icons with a meaning 3:1, on the page and on glass. Not for `--gl-color-primary-text`: the light orange reads 2.43:1 as text, but a fixed mix would darken every brand alike. Where a light theme keeps the orange, set `[data-theme="light"] { --gl-color-primary-text: var(--gl-color-primary-on-surface); }` (5.8:1). Never lower the muted tokens again for a lighter look; the inactive tab labels (10px, `--gl-icon-muted`) stay below 4.5:1 — `--gl-tab-bar-color` raises them.
|
|
202
|
+
|
|
201
203
|
> **Do not put text in `--gl-color-success` / `--error` / `--primary` on a tinted
|
|
202
204
|
> surface.** Those values are fills. Use the matching `-on-surface` token, which is what
|
|
203
205
|
> `.glass-badge--*` does.
|
|
@@ -265,7 +267,7 @@ The same in both themes; `data-surface="solid"` sets them to `none` (the thumb's
|
|
|
265
267
|
| `--gl-radius-xs` | `8px` | Small elements |
|
|
266
268
|
| `--gl-radius-sm` | `12px` | Badges, small containers |
|
|
267
269
|
| `--gl-radius-input` | `14px` | Inputs, textareas |
|
|
268
|
-
| `--gl-radius-btn` | `16px` | Buttons |
|
|
270
|
+
| `--gl-radius-btn` | `16px` | Buttons (since 1.31.0 through `--gl-btn-radius`), lists, status card, toasts, accordion, segmented control |
|
|
269
271
|
| `--gl-radius-card` | `24px` | Cards |
|
|
270
272
|
| `--gl-radius-full` | `9999px` | Fully rounded |
|
|
271
273
|
| `--gl-radius-pill` | `50%` | Circle shape |
|
|
@@ -630,6 +632,8 @@ Full-width buttons (56px height) with three variants and size modifiers.
|
|
|
630
632
|
|
|
631
633
|
**Heights** are density tokens: `--gl-btn-height`, `-sm`, `-lg` — 56 / 44 / 64px, or 40 / 32 / 48px with `data-density="compact"` on `<html>` (since 1.21.0).
|
|
632
634
|
|
|
635
|
+
**Shape and room (since 1.31.0)** are button hooks: `--gl-btn-radius` (unset `--gl-radius-btn`, which lists, the status card, toasts, the accordion and the segmented control share — so `--gl-btn-radius: 9999px` gives pill buttons and nothing else changes; never set `--gl-radius-btn` for that) and `--gl-btn-padding-x`, the room beside the label (unset 24px; before, only `--auto` had it and every other button the browser's 6px, so a small button sized by its text touched it). `--sm` reads `--gl-btn-radius-sm` and `--gl-btn-padding-x-sm` first, then those, and keeps its 12px radius while none is set.
|
|
636
|
+
|
|
633
637
|
**Icons:** Button SVGs need **no inline `fill`/`stroke` attributes** – GlassKit styles them automatically: outline style (`fill: none; stroke: currentColor; stroke-width: 2`, round caps/joins) as the default, `--secondary`/`--tertiary` use their icon tokens, `--primary` renders icons filled. For deliberately filled icons (e.g. brand logos like the GitHub mark) add `glass-icon--fill` to the `<svg>`.
|
|
634
638
|
|
|
635
639
|
**Links as buttons:** `.glass-btn` also works on `<a>` elements – anchors render as `inline-flex` with `text-decoration: none`, so `--auto` shrink-wraps exactly like on a real `<button>`.
|
|
@@ -1455,6 +1459,7 @@ More options than fit — seven areas on a phone: without a modifier the row sta
|
|
|
1455
1459
|
| `.glass-segmented__icon` | An icon before the label (since 1.28.0): an SVG strokes in the option's colour, a font icon or any element inherits it; 18px |
|
|
1456
1460
|
| `.glass-segmented--icons` | Icons alone, square options; each option's name in `aria-label` and `title` (since 1.28.0) |
|
|
1457
1461
|
| `.glass-segmented__badge` | A count after the label — neutral, or in the option's tone; inside `__icon` at the icon's corner (since 1.29.0) |
|
|
1462
|
+
| `.glass-segmented__badge--primary` / `--success` / `--warning` / `--error` | The count in a colour of its own, whatever the option's tone, without the dot (since 1.31.0) |
|
|
1458
1463
|
| `.glass-segmented--droplet` | The chosen option sits on a drop of glass that glides to the next one (since 1.27.0) — recommended |
|
|
1459
1464
|
|
|
1460
1465
|
**Icons (since 1.28.0).** `.glass-segmented__icon` inside an option shows an icon before its label, in the option's colour; under the drop it grows like the tone dot. Mark it `aria-hidden="true"`. `--icons` on the row is for options that show their icon alone — a light / dark / auto switch: the options become square, and each carries its name as `aria-label` (and `title`, for the pointer).
|
|
@@ -1470,7 +1475,7 @@ More options than fit — seven areas on a phone: without a modifier the row sta
|
|
|
1470
1475
|
</div>
|
|
1471
1476
|
```
|
|
1472
1477
|
|
|
1473
|
-
**Counts (since 1.29.0).** `.glass-segmented__badge` after an option's label shows how much waits behind it — open invoices, new tickets — where the tone dot only says that something does. A small pill in tabular figures, inline, so a scrolling row and the drop measure the option with it. Neutral without a tone (a tint of the text colour over the state scrim; `--gl-segmented-badge-bg` and `--gl-segmented-badge-color`, both colours), the state tint of `.glass-badge` with one. Inside `.glass-segmented__icon` it sits at the icon's corner, as on the tab bar, and is opaque there — the place for an `--icons` row. Never put the count into the label text ("Tickets (1)"): it can then be neither styled nor announced apart. The number is no name, so give the option an `aria-label` that says it.
|
|
1478
|
+
**Counts (since 1.29.0).** `.glass-segmented__badge` after an option's label shows how much waits behind it — open invoices, new tickets — where the tone dot only says that something does. A small pill in tabular figures, inline, so a scrolling row and the drop measure the option with it. Neutral without a tone (a tint of the text colour over the state scrim; `--gl-segmented-badge-bg` and `--gl-segmented-badge-color`, both colours), the state tint of `.glass-badge` with one. Inside `.glass-segmented__icon` it sits at the icon's corner, as on the tab bar, and is opaque there — the place for an `--icons` row. Never put the count into the label text ("Tickets (1)"): it can then be neither styled nor announced apart. The number is no name, so give the option an `aria-label` that says it. **Colours and size (since 1.31.0):** `.glass-segmented__badge--primary`, `--success`, `--warning` and `--error` colour the count alone — the look of the badge variants, without the dot a tone puts before the label; where the option has a tone too, the count's own colour wins. `--gl-segmented-badge-height` (16px, also its least width), `--gl-segmented-badge-font-size` (11px) and `--gl-segmented-badge-border` (a colour: a hairline drawn inside the neutral count, unset none). All four colours reach 4.7:1 or more in both themes, inline and at the corner, chosen or not.
|
|
1474
1479
|
|
|
1475
1480
|
```html
|
|
1476
1481
|
<button class="glass-segmented__item glass-segmented__item--warning" aria-pressed="false" aria-label="Tickets, 1 open">
|
|
@@ -2126,6 +2131,8 @@ Key points in this composition:
|
|
|
2126
2131
|
| Overriding the tab label's `font-size` or the bar's `z-index` | `--gl-tab-bar-label-size`, `--gl-tab-bar-z-index` (since 1.28.0) |
|
|
2127
2132
|
| Restyling the chosen segmented option for a dark brand | `--gl-segmented-active-bg`, `-color`, `-shadow` (since 1.28.0) |
|
|
2128
2133
|
| A count in a segmented label, "Tickets (1)" | `.glass-segmented__badge` after the label, the count in the option's `aria-label` (since 1.29.0) |
|
|
2134
|
+
| A tone on the option only to colour its count, or `--gl-segmented-badge-bg` / `-color` set to a state colour | `.glass-segmented__badge--error` (or `--primary`, `--success`, `--warning`) — no dot (since 1.31.0) |
|
|
2135
|
+
| `--gl-radius-btn` set for pill-shaped buttons | `--gl-btn-radius: 9999px` — lists, toasts and the segmented control keep theirs (since 1.31.0) |
|
|
2129
2136
|
| Overriding `height` of `.glass-btn`, `.glass-input` etc. for a denser UI | `data-density="compact"` on `<html>`, or set a density token — toggle thumb and label alignment follow the tokens, not a hand-set `height` |
|
|
2130
2137
|
|
|
2131
2138
|
---
|