@zazz-ui/core 0.1.0 → 0.3.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 +167 -0
- package/README.md +53 -7
- package/dist/sri.json +40 -40
- package/dist/zazz.css +1 -1
- package/examples/components.html +1 -6
- package/package.json +1 -1
- package/src/base/_layers.css +14 -4
- package/src/base/_layout.css +5 -2
- package/src/base/_typography.css +24 -6
- package/src/base/_utilities.css +525 -395
- package/src/base/_variables.css +22 -81
- package/src/base/_view-transitions.css +1 -1
- package/src/base/embla.d.ts +1 -0
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.ts +3 -3
- package/src/base/utils.d.ts +1 -1
- package/src/base/utils.js +1 -1
- package/src/base/utils.ts +1 -1
- package/src/globals.d.ts +3 -3
- package/src/index.css +13 -5
- package/src/manifest.ts +6 -6
- package/src/primitives/accordion/accordion.css +2 -2
- package/src/primitives/alert-dialog/alert-dialog.css +2 -2
- package/src/primitives/badge/badge.css +30 -26
- package/src/primitives/button/button.css +44 -38
- package/src/primitives/carousel/carousel.css +2 -2
- package/src/primitives/carousel/carousel.d.ts +32 -0
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.html +1 -1
- package/src/primitives/carousel/carousel.js +0 -31
- package/src/primitives/carousel/carousel.ts +1 -0
- package/src/primitives/checkbox/checkbox.css +21 -12
- package/src/primitives/combobox/combobox.css +17 -15
- package/src/primitives/command/command.css +1 -1
- package/src/primitives/dialog/dialog.css +18 -20
- package/src/primitives/fields/fields.css +14 -10
- package/src/primitives/input/input.css +10 -8
- package/src/primitives/input-group/input-group.css +18 -18
- package/src/primitives/kbd/kbd.css +2 -2
- package/src/primitives/lightbox/lightbox.css +7 -13
- package/src/primitives/meter/meter.css +2 -2
- package/src/primitives/mobile-menu/mobile-menu.css +6 -6
- package/src/primitives/otp/otp.css +9 -6
- package/src/primitives/password-group/password-group.css +18 -18
- package/src/primitives/popover/popover.css +2 -2
- package/src/primitives/progress/progress.css +2 -2
- package/src/primitives/radio/radio.css +12 -8
- package/src/primitives/select/select.css +27 -20
- package/src/primitives/slider/slider.css +4 -4
- package/src/primitives/switch/switch.css +8 -8
- package/src/primitives/table/table.css +3 -3
- package/src/primitives/tabs/tabs.css +13 -9
- package/src/primitives/textarea/textarea.css +10 -7
- package/src/primitives/toaster/toaster.css +7 -7
- package/src/primitives/toggle/toggle.css +35 -32
- package/src/primitives/tooltip/tooltip-disabled.html +1 -6
- package/src/primitives/tooltip/tooltip-sides.html +3 -22
- package/src/primitives/tooltip/tooltip-with-kbd.html +1 -6
- package/src/primitives/tooltip/tooltip.css +6 -4
- package/src/primitives/tooltip/tooltip.html +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,173 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@zazz-ui/core`, grouped by primitive or base scope under each version. The grouping is load-bearing: the `zazz-ui` CLI's `update` and `diff` print only the slice that touches the files you've vendored. Breaking entries are flagged **BREAKING** with a one-line migration note. During 0.x, a minor bump means at least one breaking entry (ADR-0010 has the full definition of "breaking").
|
|
4
4
|
|
|
5
|
+
## 0.3.0 (2026-09-02)
|
|
6
|
+
|
|
7
|
+
Three themes: (1) **theming is single-source** — every theme role is declared once as a `light-dark()` pair, and `.dark`/`.light`/`[data-theme]` are pure `color-scheme` pins that re-resolve the same tokens (the inverted-popover feature is removed); (2) **utility classes go fully logical** — every physical-side declaration becomes its logical equivalent, every side-named class gains a logical-name alias, and border widths and dividers arrive; (3) the **cascade layer contract is reworked** around `vendors`, a grouped `legacy`, `zazz.plugins`, and `overrides`. In LTR horizontal writing with system theming, default rendering is unchanged except where flagged below.
|
|
8
|
+
|
|
9
|
+
### base
|
|
10
|
+
|
|
11
|
+
- Theme roles are now **declared exactly once** as `light-dark()` pairs on `:root`; `.dark`/`.light` and `[data-theme="dark"|"light"]` are pure `color-scheme` pins that also re-assert `color`. Scopes nest — a `.light` island inside a `.dark` section re-lightens its subtree. Override a role once (`--primary: light-dark(…, …)`) and every mode picks it up. **Visible change:** the manual/toggled dark palette had drifted from the system-dark arms and is now reconciled to them — `--border` (tint-100), `--popover` (neutral-950), `--primary`/`--secondary` (800), `--tertiary` (800) replace the stale tint-200/shade-950/500/400 copies, so toggled dark now matches system dark exactly.
|
|
12
|
+
- **BREAKING** The inverted-popover feature is removed: the `--use-inverted-popovers` property and the `data-use-inverted-menu` attribute no longer exist. Popovers follow the page's color scheme. Migration: delete both from your markup/CSS; to force a dark popover, set `color-scheme: dark` on it (tokens re-resolve automatically).
|
|
13
|
+
- New **text-decoration utilities**: `underline`, `overline`, `line-through`, `no-underline`.
|
|
14
|
+
- New **border width utilities**: `border-1` to `border-4` (all sides), per-side `border-{t|b}-{1-4}`, `border-{l|s}-{1-4}`, `border-{r|e}-{1-4}`. Compose with border color classes. Not responsive.
|
|
15
|
+
- New **divider utilities**: `divide-x` / `divide-y` draw a 1px border on the trailing logical edge of every direct child except the last. Children inherit `--_border-color`, so border color classes on the container recolor the dividers.
|
|
16
|
+
- New **logical-name aliases** (identical values to their physical-name twins): `inline-*`/`block-*` for `w-*`/`h-*` (plus `min-`/`max-` variants), `start-*`/`end-*` for `left-*`/`right-*`, `ps-*`/`pe-*` for `pl-*`/`pr-*`, `ms-*`/`me-*` for `ml-*`/`mr-*` (negative margins included), `border-s`/`border-e` for `border-l`/`border-r`, `rounded-s/e/ss/se/ee/es-*` for `rounded-l/r/tl/tr/br/bl-*`, and `text-start`/`text-end` for `text-left`/`text-right` (responsive variants included).
|
|
17
|
+
- Positioning, border, radius, and text-align utilities converted from physical to logical properties/values: `left:` → `inset-inline-start:`, `border-right:` → `border-inline-end:`, physical corner radii → `border-start-start-radius` etc., `text-align: left|right` → `start|end`. Rendering only changes in RTL/vertical writing modes, where utilities now mirror with the text direction.
|
|
18
|
+
- **BREAKING** Internal radius composition variables renamed to logical corners: `--_radius-top-left|top-right|bottom-right|bottom-left` → `--_radius-start-start|start-end|end-end|end-start`. Migration: rename in any custom CSS that reads or sets the `--_radius-*` vars (they are internal, so most consumers are unaffected).
|
|
19
|
+
- Fix: `z-isolate` declared invalid `z-index: isolate` (a no-op); now `isolation: isolate` as documented.
|
|
20
|
+
- Fix: `--ui-prose-figcaption-gap` was consumed by `.ui-prose figure` but never declared; now declared (`0px`, preserving current spacing) so the hook works.
|
|
21
|
+
- Fix: the `global-view-transition--old` keyframes read `--view-transition-opacity--new`; they now read `--view-transition-opacity--old`, making that documented hook functional (defaults are identical, so default rendering is unchanged).
|
|
22
|
+
- Fix: article containers' `data-container="full"|"bleed"` referenced undeclared `--article-full`/`--article-bleed` tokens (the rules were invalid and fell back to auto width); they now implement band-container semantics — `full` spans the available width keeping gutters, `bleed` runs edge to edge.
|
|
23
|
+
- **BREAKING** Cascade layer contract reworked: top-level order is now `variables, reset, vendors, legacy, zazz, overrides`. New `vendors` layer for third-party CSS that does not build on Zazz (above `reset` so the reset can't clobber library widgets, below `legacy`). The `migrations` top-level layer moved to a `legacy.migrations` sublayer — `legacy` now nests `imports, components, utilities, migrations`, so deleting a finished migration is dropping one layer; shims still beat all other legacy CSS but no longer beat Zazz (use `overrides` for that). New `zazz.plugins` sublayer between `components` and `utilities` for Zazz-dependent extensions (added variants can restyle the primitives they extend; utilities still win). New `overrides` top-level layer as the structured app-override slot — only unlayered CSS outranks it. Migration: import whole legacy files with `layer(legacy.imports)` (never bare `layer(legacy)` — un-sublayered rules form an implicit final sublayer that beats the shims), move `migrations.css` to `layer(legacy.migrations)`, and move any shim that had to override Zazz into `@layer overrides`.
|
|
24
|
+
|
|
25
|
+
### button
|
|
26
|
+
|
|
27
|
+
- Buttons paint with `background-clip: padding-box`, and filled variants (`primary`, `secondary`, `muted`, …) now default their border color to the variant background (`--ui-button-border-color: var(--ui-button-background)` and the `--hover`/`--active` pairs) instead of `transparent`. Same rendered look with cleaner edges on translucent backgrounds; if you overrode a variant background, its border now follows automatically.
|
|
28
|
+
|
|
29
|
+
### badge
|
|
30
|
+
|
|
31
|
+
- Same treatment as buttons: `background-clip: padding-box`, and variant border colors default to the variant background instead of `transparent`.
|
|
32
|
+
|
|
33
|
+
### carousel
|
|
34
|
+
|
|
35
|
+
- Example markup: dropped a redundant `font-heading` class from the example heading (`text-h5` already applies the heading weight).
|
|
36
|
+
|
|
37
|
+
### tooltip
|
|
38
|
+
|
|
39
|
+
- Example markup no longer carries `data-use-inverted-menu="false"` — the attribute was removed with the inverted-popover feature (see base).
|
|
40
|
+
|
|
41
|
+
## 0.2.0 (2026-08-31)
|
|
42
|
+
|
|
43
|
+
Token naming consistency pass + shared field-family inheritance. Two themes: (1) every token is now named after the **logical** CSS property it feeds (`-block-size`, never `-height`), and interactive controls decompose borders into `-border-width` / `-border-style` / `-border-color` parts; (2) buttons, toggles, tabs, checkboxes, radios, and badge borders now **default to the shared `--ui-field-*` family**, so one `--ui-field-radius` or `--ui-field-block-size` override retunes every control that sits on a line together. Default rendering is unchanged — the new aliases resolve to the same values.
|
|
44
|
+
|
|
45
|
+
### base
|
|
46
|
+
|
|
47
|
+
- **BREAKING** `fields.css` now registers first among primitives in `index.css` (it owns the shared `--ui-field-*` family); `CSS_CASCADE_ORDER` and the `button`/`badge`/`tabs`/`checkbox` manifest entries gained a `fields` dependency. Migration: re-run `zazz-ui update` (vendored) or re-emit your import order from the manifest; hand-maintained subsets must load `fields.css` before its consumers.
|
|
48
|
+
- CONVENTIONS.styles.md §5/§6 now document the token-naming rules: logical property names, full property names (no abbreviations), the border width/style/color decomposition (composed at the usage site, never into a `:root` token), `-foreground` vs `-{part}-color`, and sanctioned cross-component token defaults.
|
|
49
|
+
- Physical `top`/`left`/`width`/`height` declarations converted to logical equivalents in dialog, lightbox, mobile-menu, tooltip, carousel, and badge; remaining physical uses are commented exceptions (`anchor()` side keywords, centering idioms).
|
|
50
|
+
- **BREAKING** `group-hover:scale-*` now matches the regular `scale-*` set (`0`, `25`, `50`, `75`, `90`, `98`, `99`, `100`, `101`, `102`, `110`, `125`, `150`). Dropped `95`/`105`. Migration: `group-hover:scale-95` → `group-hover:scale-98` (or `90`); `group-hover:scale-105` → `group-hover:scale-102` (or `110`).
|
|
51
|
+
|
|
52
|
+
### fields
|
|
53
|
+
|
|
54
|
+
- **BREAKING** `--ui-field-height` → `--ui-field-block-size`. Migration: rename the token in your overrides.
|
|
55
|
+
- **BREAKING** `--ui-field-border` (color-valued) → `--ui-field-border-color`; `--ui-field-border--hover/--focus` → `--ui-field-border-color--hover/--focus`. New `--ui-field-border-width` (1px) and `--ui-field-border-style` (solid) parts. Migration: rename color overrides; width/style are now their own hooks.
|
|
56
|
+
|
|
57
|
+
### input
|
|
58
|
+
|
|
59
|
+
- **BREAKING** `--ui-input-border-radius` → `--ui-input-radius`; `--ui-input-border` (shorthand) replaced by `--ui-input-border-width/-style/-color` aliases of the field parts. Migration: rename, or override the `--ui-field-border-*` parts to move the whole family.
|
|
60
|
+
- `--ui-input-calendar-picker-radius` now defaults to `--ui-field-inset-child-radius` (same value).
|
|
61
|
+
|
|
62
|
+
### textarea
|
|
63
|
+
|
|
64
|
+
- **BREAKING** `--ui-textarea-border-radius` → `--ui-textarea-radius`; `--ui-textarea-border` replaced by `--ui-textarea-border-width/-style/-color`. `--ui-textarea-font-size` now defaults to `--ui-field-font-size` (same value).
|
|
65
|
+
|
|
66
|
+
### select
|
|
67
|
+
|
|
68
|
+
- **BREAKING** `--ui-select-border-radius` → `--ui-select-radius`; `--ui-select-border` replaced by `--ui-select-border-width/-style/-color`; `--ui-option-height` → `--ui-option-block-size`; `--ui-option-border(--hover/--active)` replaced by `--ui-option-border-width/-style/-color` (+ `-color--hover/--active`).
|
|
69
|
+
|
|
70
|
+
### otp
|
|
71
|
+
|
|
72
|
+
- **BREAKING** `--ui-otp-slot-border` replaced by `--ui-otp-slot-border-width/-style/-color`.
|
|
73
|
+
|
|
74
|
+
### combobox
|
|
75
|
+
|
|
76
|
+
- **BREAKING** `--ui-combobox-border-radius` → `--ui-combobox-radius`; `--ui-combobox-border` replaced by `--ui-combobox-border-width/-style/-color` (aliasing the select parts); `--ui-combobox-control-align` → `--ui-combobox-control-align-items`; `--ui-combobox-control-wrap` → `--ui-combobox-control-flex-wrap`; removed the dead `--ui-combobox-display` token (nothing consumed it).
|
|
77
|
+
|
|
78
|
+
### input-group
|
|
79
|
+
|
|
80
|
+
- **BREAKING** `--ui-input-group-text-size/-text-weight/-text-color` → `--ui-input-group-font-size/-font-weight/-foreground`; `--ui-input-group-align` → `-align-items`; `--ui-input-group-wrap` → `-flex-wrap`.
|
|
81
|
+
|
|
82
|
+
### password-group
|
|
83
|
+
|
|
84
|
+
- **BREAKING** same renames as input-group (`-text-*` → `-font-*`/`-foreground`, `-align` → `-align-items`, `-wrap` → `-flex-wrap`).
|
|
85
|
+
|
|
86
|
+
### button
|
|
87
|
+
|
|
88
|
+
- Button metrics now default to the shared field family: `--ui-button-block-size/-font-size/-line-height/-padding/-radius/-icon-size/-ring-color` alias `--ui-field-*`, and `--ui-button-border-width/-style` alias the field border parts (same values as before; retune `--ui-field-*` and buttons follow, remap `--ui-button-*` to diverge).
|
|
89
|
+
- **BREAKING** `--ui-button-height` → `--ui-button-block-size`; `--ui-button-border(--hover/--active)` (shorthands) replaced by `--ui-button-border-color(--hover/--active)` color parts. Migration: rename; to restyle the whole border override the width/style/color parts.
|
|
90
|
+
|
|
91
|
+
### toggle
|
|
92
|
+
|
|
93
|
+
- **BREAKING** `--ui-toggle-height` → `--ui-toggle-block-size`; `--ui-toggle-border*` shorthands replaced by `--ui-toggle-border-width/-style/-color` (+ `-color--hover/--active/--checked/--checked-hover/--checked-active`), defaulting to the button parts.
|
|
94
|
+
|
|
95
|
+
### badge
|
|
96
|
+
|
|
97
|
+
- **BREAKING** `--ui-badge-height` → `--ui-badge-block-size`; `--ui-badge-border(--hover/--active)` replaced by `--ui-badge-border-width/-style/-color` parts. Border + ring now default to `--ui-field-*` (same values); metrics stay an independent smaller scale.
|
|
98
|
+
|
|
99
|
+
### tabs
|
|
100
|
+
|
|
101
|
+
- **BREAKING** `--ui-tabs-label-min-height` → `--ui-tabs-label-min-block-size`.
|
|
102
|
+
- Track/label metrics now default to the field family: `--ui-tabs-track-radius` (`--ui-field-radius`), `--ui-tabs-indicator-radius` (`--ui-field-inset-child-radius`), label font-size/line-height/padding/ring-color (same values as before).
|
|
103
|
+
|
|
104
|
+
### checkbox
|
|
105
|
+
|
|
106
|
+
- **BREAKING** `--ui-checkbox-border(--hover/--checked)` → `--ui-checkbox-border-color(--hover/--checked)`, plus new width/style parts. Tokens moved from the element onto `:root` in `@layer variables` (they are now overridable from `:root` like every other hook); surface + border default to `--ui-field-*`.
|
|
107
|
+
|
|
108
|
+
### radio
|
|
109
|
+
|
|
110
|
+
- **BREAKING** `--ui-radio-border(--hover/--checked)` → `--ui-radio-border-color(--hover/--checked)`, plus new width/style parts; surface + border default to `--ui-field-*`.
|
|
111
|
+
|
|
112
|
+
### switch
|
|
113
|
+
|
|
114
|
+
- **BREAKING** `--ui-switch-track-width/-track-height` → `--ui-switch-track-inline-size/-track-block-size`; `--ui-switch-thumb` → `--ui-switch-thumb-background`.
|
|
115
|
+
|
|
116
|
+
### dialog
|
|
117
|
+
|
|
118
|
+
- **BREAKING** `--ui-dialog-width/-height` → `--ui-dialog-inline-size/-block-size`; removed the dead `--ui-dialog-display` token (nothing consumed it).
|
|
119
|
+
|
|
120
|
+
### alert-dialog
|
|
121
|
+
|
|
122
|
+
- **BREAKING** `--ui-alert-dialog-width` → `--ui-alert-dialog-inline-size`.
|
|
123
|
+
|
|
124
|
+
### progress
|
|
125
|
+
|
|
126
|
+
- **BREAKING** `--ui-progress-height` → `--ui-progress-block-size`.
|
|
127
|
+
|
|
128
|
+
### meter
|
|
129
|
+
|
|
130
|
+
- **BREAKING** `--ui-meter-height` → `--ui-meter-block-size`.
|
|
131
|
+
|
|
132
|
+
### slider
|
|
133
|
+
|
|
134
|
+
- **BREAKING** `--ui-slider-track-height` → `--ui-slider-track-block-size`.
|
|
135
|
+
|
|
136
|
+
### table
|
|
137
|
+
|
|
138
|
+
- **BREAKING** `--ui-table-head-height` → `--ui-table-head-block-size`.
|
|
139
|
+
|
|
140
|
+
### toaster
|
|
141
|
+
|
|
142
|
+
- **BREAKING** `--ui-toaster-width` → `--ui-toaster-inline-size`; `--ui-toaster-description-color` → `--ui-toaster-description-foreground`; `--ui-toaster-border` → `--ui-toaster-border-color` (it held a color).
|
|
143
|
+
|
|
144
|
+
### carousel
|
|
145
|
+
|
|
146
|
+
- **BREAKING** `--ui-carousel-slide-min-width` → `--ui-carousel-slide-min-inline-size`.
|
|
147
|
+
|
|
148
|
+
### kbd
|
|
149
|
+
|
|
150
|
+
- **BREAKING** `--ui-kbd-color` → `--ui-kbd-foreground`.
|
|
151
|
+
|
|
152
|
+
### mobile-menu
|
|
153
|
+
|
|
154
|
+
- **BREAKING** `--ui-mobile-menu-backdrop` → `--ui-mobile-menu-backdrop-color`.
|
|
155
|
+
|
|
156
|
+
### accordion
|
|
157
|
+
|
|
158
|
+
- **BREAKING** `--ui-accordion-icon-transform-open` → `--ui-accordion-icon-transform--open` (double-dash state convention).
|
|
159
|
+
|
|
160
|
+
### popover
|
|
161
|
+
|
|
162
|
+
- **BREAKING** `--ui-popover-border` → `--ui-popover-border-color` (it held a color).
|
|
163
|
+
|
|
164
|
+
### tooltip
|
|
165
|
+
|
|
166
|
+
- **BREAKING** `--ui-tooltip-border` → `--ui-tooltip-border-color` (it held a color).
|
|
167
|
+
|
|
168
|
+
### lightbox
|
|
169
|
+
|
|
170
|
+
- **BREAKING** Removed dead tokens nothing consumed: `--ui-lightbox-thumb-border(--active)` (the thumb border comes from `--ui-lightbox-img-border`; active/focus feedback is the inset ring + opacity), `--ui-lightbox-radius` (slides/thumbs use `--ui-lightbox-slide-radius` / `--ui-lightbox-thumb-radius`), and `--ui-lightbox-thumb-aspect-ratio`. Migration: delete overrides of these; retune the named replacements instead.
|
|
171
|
+
|
|
5
172
|
## 0.1.0 (2026-08-28)
|
|
6
173
|
|
|
7
174
|
First public release. One package, consumed three ways: the `dist/zazz.css` + `dist/zazz.js` bundles for a two-tag CDN drop-in, per-file CDN URLs into the readable `src/` tree, or copying the code into your project and owning it.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Zazz is a CSS and vanilla JavaScript UI kit that does not require a build step. It uses semantic design tokens, cascade layers, `data-*` variants, and browser APIs such as popover, `<dialog>`, invoker commands, anchor positioning, and view transitions.
|
|
4
4
|
|
|
5
|
-
Docs: https://zazz.sh (component gallery, tokens, guides)
|
|
5
|
+
Docs: <https://zazz.sh> (component gallery, tokens, guides, and a [build-your-first-page tutorial](https://zazz.sh/docs/getting-started/first-page))
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -18,8 +18,8 @@ import "@zazz-ui/core"; // custom elements and shared behaviors
|
|
|
18
18
|
From a CDN:
|
|
19
19
|
|
|
20
20
|
```html
|
|
21
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.
|
|
22
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.
|
|
21
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.3.0/dist/zazz.css" />
|
|
22
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@zazz-ui/core@0.3.0/dist/zazz.js"></script>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Use an exact version in CDN URLs. Each release includes `dist/sri.json`, which lists the SHA-384 hash for every published file. Use those hashes in `integrity` attributes.
|
|
@@ -32,23 +32,69 @@ You can also copy files directly. Each primitive has a folder under `src/primiti
|
|
|
32
32
|
<button class="ui-button" data-variant="primary">It works!</button>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Components are classes (`.ui-button`, `.ui-dialog`, `.ui-field`), and variants are `data-*` attributes (`data-variant`, `data-size`) rather than modifier classes.
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Theming
|
|
38
|
+
|
|
39
|
+
Every value in the kit resolves from a CSS custom property, which gives you three override surfaces:
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
/* 1. Global tokens move the whole system */
|
|
43
|
+
:root {
|
|
44
|
+
--primary: oklch(0.6 0.2 145);
|
|
45
|
+
--radius-md: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* 2. Component hooks (--ui-*) restyle one primitive everywhere */
|
|
49
|
+
:root {
|
|
50
|
+
--ui-button-radius: var(--radius-full);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<!-- 3. The same hooks set inline restyle one instance -->
|
|
56
|
+
<button class="ui-button" style="--ui-button-background: var(--secondary)">One-off</button>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Color roles resolve through `light-dark()`, so light and dark themes work out of the box and follow the OS preference (pin one with a `.dark` class on `<html>`). Styles live in cascade layers, so your own CSS can override anything without `!important` or specificity fights. The [extending guide](https://zazz.sh/docs/core-concepts/extending) covers adding your own tokens, utilities, and variants.
|
|
38
60
|
|
|
61
|
+
## Layout
|
|
62
|
+
|
|
63
|
+
The `.container` is not a fixed-width box. A region (`main`, `header`, `footer`, `section`, `article`) holding a `.container` becomes a grid of named width bands, and each direct child of the container picks its band. Measured text and full-bleed media can be siblings in the same flow:
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<section>
|
|
67
|
+
<div class="container">
|
|
68
|
+
<h2>Sits in the default md band</h2>
|
|
69
|
+
<figure data-container="bleed">
|
|
70
|
+
<img src="/wide.jpg" alt="" />
|
|
71
|
+
</figure>
|
|
72
|
+
<p>Back to the md band.</p>
|
|
73
|
+
</div>
|
|
74
|
+
</section>
|
|
39
75
|
```
|
|
76
|
+
|
|
77
|
+
See [layout and containers](https://zazz.sh/docs/core-concepts/layout) for the band model, the article reading-measure variant, and responsive container variants.
|
|
78
|
+
|
|
79
|
+
## Browser support
|
|
80
|
+
|
|
81
|
+
Zazz targets the latest Chrome, Firefox, and Safari, two versions back. Features below that floor are feature-detected with a polyfill or a graceful fallback where practical. The kit leans on modern CSS (cascade layers, container style queries, subgrid, `light-dark()`), so older browsers get a degraded but functional experience rather than a pixel-perfect one.
|
|
82
|
+
|
|
83
|
+
## Package layout
|
|
84
|
+
|
|
85
|
+
```text
|
|
40
86
|
src/
|
|
41
87
|
├── index.css stylesheet entry: @imports base + every primitive in cascade order
|
|
42
88
|
├── index.js script entry: registers every custom element / behavior
|
|
43
89
|
├── base/ tokens, reset, typography, utilities, layout + shared runtime
|
|
44
|
-
└── primitives/<name>/ one folder per primitive: <name>.css, <name>.
|
|
90
|
+
└── primitives/<name>/ one folder per primitive: <name>.css, <name>.ts, examples (.html)
|
|
45
91
|
dist/
|
|
46
92
|
├── zazz.css flattened single-file bundle (loaded by CDN tags)
|
|
47
93
|
├── zazz.js
|
|
48
94
|
└── sri.json sha384 hashes of every published css/js file
|
|
49
95
|
```
|
|
50
96
|
|
|
51
|
-
The package includes readable, unminified `.js` and matching `.d.ts` files compiled from TypeScript.
|
|
97
|
+
The package includes readable, unminified `.js` and matching `.d.ts` files compiled from TypeScript. Component scripts are optional: the CSS works on its own, and the scripts add behaviors (typeahead, carousels, command menus, hotkeys) as custom elements and small helpers.
|
|
52
98
|
|
|
53
99
|
## Development
|
|
54
100
|
|
package/dist/sri.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"dist/zazz.css": "sha384-
|
|
2
|
+
"dist/zazz.css": "sha384-XRnKV6BhLEZ+Wd5XP10+LsmDA7lHqY3Q6X61eFd9ly+Mg5w6b8p77PbCJONadcMk",
|
|
3
3
|
"dist/zazz.js": "sha384-aPfxDnhH5V87Iwa/0sKglKCN/caKacvP5Lw99Xej2K51HI4UFKYF/6G6tbZ7ySzs",
|
|
4
|
-
"src/base/_layers.css": "sha384-
|
|
5
|
-
"src/base/_layout.css": "sha384-
|
|
4
|
+
"src/base/_layers.css": "sha384-6lai/sx1zuGAK8TfF02TCc4FGE5rNs57GrNpz5FDs4u0BK5F26g36jycNQPXxkDs",
|
|
5
|
+
"src/base/_layout.css": "sha384-xmqjLFPKpqjGpFVEmMjoKsZiWb+hVQ0u5AceRpnkdWuH56nrMS7XqrfaAfelLJGa",
|
|
6
6
|
"src/base/_reset.css": "sha384-+nvxayQr5UV3DlJHhpltIJRD7pLwOTCX3HSVeQAZZR3G6w1Hms5B46NoN3l3B9M1",
|
|
7
|
-
"src/base/_typography.css": "sha384
|
|
8
|
-
"src/base/_utilities.css": "sha384-
|
|
9
|
-
"src/base/_variables.css": "sha384-
|
|
10
|
-
"src/base/_view-transitions.css": "sha384-
|
|
7
|
+
"src/base/_typography.css": "sha384-+t4TGUCrY+5KlIuKpvfCCWRl8NCPhY3lUZjX9bFD4uYWvOpeShlEQWldxXoa/1lG",
|
|
8
|
+
"src/base/_utilities.css": "sha384-fj57L+24msXeBG+X4+g8RWQ+xKU2O5kBGZfutYL9+7IRySw61z1xnr3KhsJZkwup",
|
|
9
|
+
"src/base/_variables.css": "sha384-kWgPE4BgqnCSLZB+AswU43O9+ZRXthmOXHSskLGBv8PzUQlwMZPkWBWTwSd89J7X",
|
|
10
|
+
"src/base/_view-transitions.css": "sha384-IwttrGYS0xBYXBsjQoY4qHS266SOjGlYwfsdoEEaEWvJaEQMV2xB9U35sj5BfL6c",
|
|
11
11
|
"src/base/command-score.js": "sha384-1+Wn/S4VV+ICEqn3ekwMNPmWpAMZemIVULpSflx1eqJvzxcbq16v4uhRt9ebongt",
|
|
12
12
|
"src/base/dialog-lifecycle.js": "sha384-xuMHW1urqWKKEYA6raOIDHsgj9TTBir7ku9WxE/KsmMwxBpazEZKGhMfM37zC5RP",
|
|
13
13
|
"src/base/embla.js": "sha384-Gpd9ylfh+ExtTg87yNMGBRhRaeU6LptO3RKXUlfMOW35UMXjC9ni6gRAST8FuCqB",
|
|
@@ -16,60 +16,60 @@
|
|
|
16
16
|
"src/base/reveal.js": "sha384-XBh9JUP0jyS6TtcbEtBoeumSS6xBW50PVslmjvAVz80/wVgHGDck6Cd6+xxSnxSy",
|
|
17
17
|
"src/base/signals.js": "sha384-iyU+iAMEszJi5fYt1eGYhgLS2r8EXOt6PZhDg2OzDuIyDkQslchF3E+QyuT4CF8R",
|
|
18
18
|
"src/base/typeahead.js": "sha384-K9VWaRNbfalI0PDE0Y2dLb8Zg3GNdpasUATbBgeM6W0P6Yn0oWd+mr0y/R/f25zq",
|
|
19
|
-
"src/base/utils.js": "sha384-
|
|
19
|
+
"src/base/utils.js": "sha384-iwJoEs/fLdpt/TEDOQo+tk0Ao0vuEfGrE1bGGaM8OSXv6NgCY78LxQ/YiR6/AxF4",
|
|
20
20
|
"src/base/zazz-element.js": "sha384-6YCkr165EheG5e/nJbvFHTgeBL5HV3N0spXJiq5ZNArQyhUMV47dtyhrzaZTnTrr",
|
|
21
21
|
"src/head.js": "sha384-LWNGGFWPTlhFEEVAAgXcGsG6sslA6iKG4+SinHNwKMSKwJTWbZyutYYx7ZeaX0RB",
|
|
22
|
-
"src/index.css": "sha384-
|
|
22
|
+
"src/index.css": "sha384-LdiaQ4o6WjSPrZVXXBBYhXYFs2m/Pmjz+G38UdFNWm4j0F4lAltMRC8pfl0pwkXP",
|
|
23
23
|
"src/index.js": "sha384-oiwIyfPR++s0gEHK1AhBCJ0801zVMgDs8n65WF7mM2RSnR3ME7ZKUFslUf8rV+5k",
|
|
24
24
|
"src/manifest.js": "sha384-MaI6+2vkyPrNjZ79XUAfwr3T6d7ud+fu8Ar5l1B8JmFlhek2ccfLeE4fV81qdwGv",
|
|
25
|
-
"src/primitives/accordion/accordion.css": "sha384
|
|
26
|
-
"src/primitives/alert-dialog/alert-dialog.css": "sha384-
|
|
25
|
+
"src/primitives/accordion/accordion.css": "sha384-4lKoG9z38aKRyb3OxKaFRDGuxdQy55f/PWXnqoYDuuXsDb4Zs+19wsM3rO2215iR",
|
|
26
|
+
"src/primitives/alert-dialog/alert-dialog.css": "sha384-b2kvZNJgYFImVnNTP8IlnUB5JhXHDi55tsdUoiukMUsztH+0CL/CMuCYVoPi7bRv",
|
|
27
27
|
"src/primitives/autocomplete/autocomplete.css": "sha384-R0blgYdjEdnkCSPeWwGJO7dQAxRE2Op8kQreqgpTXESFxNSjKi//WSCUEyNre3k3",
|
|
28
28
|
"src/primitives/autocomplete/autocomplete.js": "sha384-pSs//u6eySW6BvHOG2ei9L7diGOfP0lqhfhJwOtXJnMNu5UHPCr/hiRXo9XGAbs/",
|
|
29
|
-
"src/primitives/badge/badge.css": "sha384-
|
|
29
|
+
"src/primitives/badge/badge.css": "sha384-xkWBCG/Sjkcw+ixRrKfRHlrEpS/xMDWOvBkHwy89vawXPml4yIcQyQhum4mvZUe+",
|
|
30
30
|
"src/primitives/button-group/button-group.css": "sha384-exGEia7TDeu6gGQBYyOy5l++jCGlDLpi+4Js0vPvu5XJEU9h2G1itJ9I52aT5Evd",
|
|
31
|
-
"src/primitives/button/button.css": "sha384-
|
|
32
|
-
"src/primitives/carousel/carousel.css": "sha384-
|
|
33
|
-
"src/primitives/carousel/carousel.js": "sha384-
|
|
34
|
-
"src/primitives/checkbox/checkbox.css": "sha384-
|
|
31
|
+
"src/primitives/button/button.css": "sha384-Vs5F0stgUGHP6H0J2P3fdktsvi6ZwNpN246u7gmNJFUjQCvsJAjwfWT2Qz3+xASh",
|
|
32
|
+
"src/primitives/carousel/carousel.css": "sha384-LqoT3Yls+K0/N5u3TJHlOrp3F7wrnCJGAC15Tcrcxu7laBRZd6vkmPY+TKkIhd+i",
|
|
33
|
+
"src/primitives/carousel/carousel.js": "sha384-vzVtcr/e8BmG3h3eKJZFSZak3Wc1mBgBPRhaZJZaDzAeqkP+FEdMDKXJYRWV07MX",
|
|
34
|
+
"src/primitives/checkbox/checkbox.css": "sha384-x0kjj5JvslE6MuQ7TbRJ3E9cJFokyGFY26DxHj3Ky5jKRakQHUG4TeV6Iv7G9Yfl",
|
|
35
35
|
"src/primitives/checkbox/checkbox.js": "sha384-Gr6vMabK4kBba1MZRichsGKTrI3qVw/NHeONsUGkIzBuXsgO5cESOU9dIJ/LMLVY",
|
|
36
|
-
"src/primitives/combobox/combobox.css": "sha384-
|
|
36
|
+
"src/primitives/combobox/combobox.css": "sha384-17Qy0ciM8GlVLIYTgRLkKohCzGwvy31/ZJ1YATwE9C86wV6RevabP8FX/9CVuRgy",
|
|
37
37
|
"src/primitives/combobox/combobox.js": "sha384-j//0AELQhqU2wyW5toz5h6BlZHGGZL349iGNJW0lQOzo7KQGPUosI1+BlgsfCKi4",
|
|
38
38
|
"src/primitives/command/command-actions.js": "sha384-T1zQ2KeawEZZ8lh6nnF02HjNvlnwFueAlLSYjd7T0F0PGOiz92pyu+9WdkeVuEzE",
|
|
39
|
-
"src/primitives/command/command.css": "sha384-
|
|
39
|
+
"src/primitives/command/command.css": "sha384-QB5DN5mSv4XrYPNro4u1a51T2mI0MbXC2OgbD2s2hxUGtb8/X7QZ56ii+ORv55Q2",
|
|
40
40
|
"src/primitives/command/command.js": "sha384-hRFC6UXV15AkehX5BZc6LxLco353Cs0wq9glzC9g61CsiaFhio5Nx2LhV50F5N61",
|
|
41
|
-
"src/primitives/dialog/dialog.css": "sha384-
|
|
42
|
-
"src/primitives/fields/fields.css": "sha384-
|
|
43
|
-
"src/primitives/input-group/input-group.css": "sha384-
|
|
44
|
-
"src/primitives/input/input.css": "sha384-
|
|
45
|
-
"src/primitives/kbd/kbd.css": "sha384-
|
|
46
|
-
"src/primitives/lightbox/lightbox.css": "sha384
|
|
41
|
+
"src/primitives/dialog/dialog.css": "sha384-Aow1Sk46Tp3aM3q/Xma0ddKNKnE2/N6LvF54lUsth4YgHegfFQ/gEiEH/ZDkVg5g",
|
|
42
|
+
"src/primitives/fields/fields.css": "sha384-O/Lp14Zind2WZQ79V+CK9uGsrwF8AINm5xwydtoOM/PiTIMDgdeF2p38TIDoQaUN",
|
|
43
|
+
"src/primitives/input-group/input-group.css": "sha384-VAzb7AbKgcu4iyYd8fyC8ThDs1YnwWjxkbhaY5brLnfCC74LpmaKjwRTVwLbzcZG",
|
|
44
|
+
"src/primitives/input/input.css": "sha384-VnxONpDEZ42QPWGoJgIx7Ew8kclzZHy/I+J10K8adgA9v66UkZsIt/5jl1AVbVdr",
|
|
45
|
+
"src/primitives/kbd/kbd.css": "sha384-27KHLMBytecE4fWCglKYxMToWA1EF2IF0eU9Fi6r7BSUuMTRCJ2FcfAbEt7PbeX+",
|
|
46
|
+
"src/primitives/lightbox/lightbox.css": "sha384-+2ypt1iWmY/NOgNqY6Witj7tqga3PzWle56Pn6UX9MWc6186yiVXMq7Ur7itqieP",
|
|
47
47
|
"src/primitives/lightbox/lightbox.js": "sha384-8AjhUn5yRUbs4Cw934kdcPPGWlxjiejkAi52DE8uRJrEX92pEulUqIfdJvA7p2QT",
|
|
48
48
|
"src/primitives/menu/menu.css": "sha384-vMg8WO5PV11zkaWxQp2iHfVKZybM4V2tHH8wvI0ZHkzTQmVdtfhj46E8yrzn583J",
|
|
49
49
|
"src/primitives/menu/menu.js": "sha384-kVpxdxcNIo2ydlnymjZ3JkKrmH6c+P32EhoMX/xhLfzgnVjbsDhfjMLPw5SlqXpq",
|
|
50
|
-
"src/primitives/meter/meter.css": "sha384-
|
|
51
|
-
"src/primitives/mobile-menu/mobile-menu.css": "sha384-
|
|
50
|
+
"src/primitives/meter/meter.css": "sha384-qHqTrporwJbDHkQ/UW6BE/l69rjfC9dO+cXEk3jXEGdtuvxtLBU1Oj+MAOoCnmjJ",
|
|
51
|
+
"src/primitives/mobile-menu/mobile-menu.css": "sha384-msuO5tWwMK3818WFnAYv/OcLwsK5M0vwADGpPNVTwNKQmfFMuzRthS3/kr8V4qYc",
|
|
52
52
|
"src/primitives/navigation-menu/navigation-menu.css": "sha384-3szXmR2urbecjmuH52FrSa610Z05LTMgz7tYo/NL0d4oFNGJzrtAkPb9CWLC0+4F",
|
|
53
|
-
"src/primitives/otp/otp.css": "sha384-
|
|
53
|
+
"src/primitives/otp/otp.css": "sha384-0oeVrtshegMYG2Y4CeNKD2NgJ5jjN8NrYUl1/r4n60R/EbGn7j6APOedUvSKHNXJ",
|
|
54
54
|
"src/primitives/otp/otp.js": "sha384-TSP2DHzrKkSVmGiuOnSrQjXYXXUro8svFyn8HVC7S/evI8gGcuY4+2HTqQ5/Opza",
|
|
55
|
-
"src/primitives/password-group/password-group.css": "sha384-
|
|
55
|
+
"src/primitives/password-group/password-group.css": "sha384-Lagi9heKIWSNTJBuSO0OsGwpCRg2+iTpxNh1y7fPbncsTsdiAXuIWePnKfb36i3X",
|
|
56
56
|
"src/primitives/password-group/password-group.js": "sha384-qWMDes6gBfYbLmOLaR+Uc32A1FFqMAANoMSy1fulKMUvqPv/zA0NvXbn1hsNT5JA",
|
|
57
|
-
"src/primitives/popover/popover.css": "sha384-
|
|
58
|
-
"src/primitives/progress/progress.css": "sha384
|
|
59
|
-
"src/primitives/radio/radio.css": "sha384-
|
|
57
|
+
"src/primitives/popover/popover.css": "sha384-zpIJJlzqePITzn/hM71A5sU0goOLKxrnxpw5uLG1vD8XTxdfuL5OjnfnSHgYq0jc",
|
|
58
|
+
"src/primitives/progress/progress.css": "sha384-qVNIdYg9NVyMJcC1yBbWtZH7M7WbOLIzMDq9AbTQibc+wUEubwThjbq+VXx4wa5n",
|
|
59
|
+
"src/primitives/radio/radio.css": "sha384-MCwj0IZencEnI7wQP3CQIq36mSBBrYr/xOg63gthW55J8AyObSoaWYHA4G6+sb3D",
|
|
60
60
|
"src/primitives/reveal/reveal.css": "sha384-/QfJXd7g2Bb4knJKr7Txt0ae5InCC3fRwasoj+Lk3lklIZE2aSf2GeJs6TQJDUFT",
|
|
61
61
|
"src/primitives/select/multiselect.js": "sha384-JMJu0pLMgqzHY/zTuyAnl8kkQwOYLTbWk0mcaQciqc9qNOXsSlEvRKlmtVITDzDG",
|
|
62
|
-
"src/primitives/select/select.css": "sha384-
|
|
62
|
+
"src/primitives/select/select.css": "sha384-emINLvgX6buNPCBGNqpxjlSx8FqGQN5Ho7FmP5EaAONna2ta1J4shjdPdrZnwuWm",
|
|
63
63
|
"src/primitives/separator/separator.css": "sha384-G01cL0eyZtOU4wxrrlSk7ep0BxqvqzRfefv9DBHsRxryRZy5rRPbjLOodugvI8qu",
|
|
64
|
-
"src/primitives/slider/slider.css": "sha384-
|
|
65
|
-
"src/primitives/switch/switch.css": "sha384-
|
|
66
|
-
"src/primitives/table/table.css": "sha384-
|
|
67
|
-
"src/primitives/tabs/tabs.css": "sha384
|
|
64
|
+
"src/primitives/slider/slider.css": "sha384-gEQ+QwVOZ3pJUq5lYUAECzJ9+TBjYMGC/RtqZOOAI0NFde5WwXHEVk7xBC1fMOUy",
|
|
65
|
+
"src/primitives/switch/switch.css": "sha384-IGXNv5UfSumA/hxNXWgm6kvWxYk/s/+6lPj2AMWX35BkqfgvSCZ7fMy7FCEiasb6",
|
|
66
|
+
"src/primitives/table/table.css": "sha384-cZZjHNv+l/4mLMci2uvSxUllb6DNGS9Zg1dOZupXyDt0JVTGznLUARm2f+1L/x/6",
|
|
67
|
+
"src/primitives/tabs/tabs.css": "sha384-jLknrtjusKMXYD2DzL5MZ3xvrfOcPAhc0S4mvoz2J32dj3ovC3leU1zM1qNTitHZ",
|
|
68
68
|
"src/primitives/tabs/tabs.js": "sha384-FfrT8E9lh5/V8prSZokemklL0NIgVFG0aVo2ZpJ62uWMFa3cFP6gZO8nCgD4Z9Zx",
|
|
69
|
-
"src/primitives/textarea/textarea.css": "sha384-
|
|
70
|
-
"src/primitives/toaster/toaster.css": "sha384-
|
|
69
|
+
"src/primitives/textarea/textarea.css": "sha384-u7gXoNvOux1RlytcKMzEIpMif08eLxI8djeNb3snFb/Dw5Jhut70Me/pMNSsl2wk",
|
|
70
|
+
"src/primitives/toaster/toaster.css": "sha384-6oud5XRUD+V+48kXu44bUopAVGRLjBjXbopA+gJqf0YnjdEtN4PpMoCyFBNNI/tf",
|
|
71
71
|
"src/primitives/toaster/toaster.js": "sha384-AF76CAJ29UZIGxf/TaXwkIrIucjNNQls8uFq9NpLxQZ0JN07dO9kmhG5VKT3Z1Vo",
|
|
72
72
|
"src/primitives/toggle-group/toggle-group.css": "sha384-hYP6iopUXkAh7nQnI+f0ZuI+g7Sl+LqtmuZ19LzpeAXtMZVN8P4HYHytao5wrHTl",
|
|
73
|
-
"src/primitives/toggle/toggle.css": "sha384-
|
|
74
|
-
"src/primitives/tooltip/tooltip.css": "sha384-
|
|
73
|
+
"src/primitives/toggle/toggle.css": "sha384-DILJL/10h/gzfOVmwvauhLyLzAP5vJqceRgHLx7LPSuz16Ji/VEzTpFFaG8GLGoA",
|
|
74
|
+
"src/primitives/tooltip/tooltip.css": "sha384-B5knFalv8A4I8JJ70v6UV6zyi5TDc2Yg5n570pJ9+C3dGDGDSSwXJpzoWMIzXz/S"
|
|
75
75
|
}
|