Repository navigation
Releases
@zazz-ui/core 0.15.0
base
- BREAKING With
data-ui-navigation="swap", Back and Forward swap only between entries the swap made. An entry the page pushed withhistory.pushState()(htmx'shx-push-urlandhx-boost, a client router) is left to the page, going into it and coming out of it, and so is any entry a script gavehistory.state(htmx stamps the first entry it swaps on with{ htmx: true }). Swapping those raced the library's own restore. A page that pushes URLs without restoring them onpopstatemust now restore them itself. data-ui-navigation="off"on an ancestor of a link or form leaves its navigation to the browser (a full load, unless another library handles the click first). The nearestdata-ui-navigationancestor decides, soswapinside an opted-out region opts back in. It needsNavigateEvent.sourceElement; without it the attribute has no effect.- New
Zazz.refresh(element), alsowindow.Zazzand a named export of the entry module: runs the refresh hooks (reveal, attribute-form carousels, select-all checkboxes, sticky states, the drawer page indent) over markup another library inserted, the element itself included. With no argument it refreshes the whole body. For htmx:htmx.onLoad((el) => Zazz.refresh(el)). - The swap remembers its history entries in
sessionStorage(zazz:navigation-entries), so Back and Forward between swapped pages still swap after a reload.
Install: npm install @zazz-ui/core@0.15.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.14.3
base
findHeadBlockand the head-block comparison inhead.ts(behind the language server's head-block fixes and the CLI) no longer use regexes that CodeQL flags as polynomial on long whitespace runs. Results are unchanged.
Install: npm install @zazz-ui/core@0.14.3, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.14.2
drawer
- A drawer removed from the page while open lets go of the page. With
data-ui-navigation="swap", following a link inside an open drawer replaces the body without closing it, and the drawer kept holding the page at its old scroll position: the next page could not be scrolled, and jittered on iOS, until a reload. The drawer now unbinds as soon as it is gone.
Install: npm install @zazz-ui/core@0.14.2, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.14.1
base
data-ui-navigation="swap"brings the destination page's stylesheets along. A<link rel="stylesheet">or<style>in its<head>that the current page lacks is added before the swap, and the swap waits for new links to load (up to three seconds). Per-page CSS, such as a framework's scoped component styles, used to be missing after in-page navigation until a reload. Stylesheets are never removed, so keep page-specific CSS scoped to that page's markup.
Install: npm install @zazz-ui/core@0.14.1, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.14.0
base
- Letter spacing has one global knob.
--tracking-modifier(default0em) shifts every--tracking-*token by that length;--tracking-heading-modifier(display, h1–h6) and--tracking-body-modifier(2xl–2xs, eyebrow) default to it and override just their group. Give each a length with a unit. - New
base/gesture.ts, the drag tracking behind toast swipes and the drawer:trackDragfollows one pointer on a locked axis and reports its offset and velocity, andshouldDismiss,pickSnap,rubberBand, andflickDurationdecide and time the release. It ships with the primitives that use it, not in the core runtime.data-ui-no-dragon any element keeps a press inside it from starting a drag. - Line height has the same kind of knob.
--leading-heading-multiplierand--leading-body-multiplier(default1) scale every--leading-*token in their group. bodyapplies every--font-*-bodyrole token (feature settings, kerning, optical sizing, thefont-variant-*group, variation settings, weight), so setting one on:rootreaches all body text.
carousel
- BREAKING The carousel no longer uses Embla. It is a native scroll-snap container: touch, trackpad, and wheel scroll it on the compositor, and it scrolls without JavaScript. The script (
base/carousel.jsandbase/carousel-scroll.js, onbase/gesture.js) adds mouse drag, loop, controls, thumbs, autoplay, auto-scroll, and state. Remove the fourembla-carousel*entries from a hand-written import map;signal-polyfillis the only one left. See ADR-0019. - BREAKING
window.EmblaInitis nowwindow.Carousel(init,initRoot). The API on a root moved from_emblaApito_carousel, also returned by<ui-carousel>.api:goTo(index, instant?),goToNext(),goToPrev(),selectedSnap(),snapList(),play(),stop(),isPlaying(). Listen forzazz:carousel-select(detail.index) on the root in place of Embla'sselectevent. - BREAKING Supported options:
data-carousel-loop,-align,-axis,-draggable,-drag-free,-skip-snaps,-start-snap,-keyboard, and theautoplayandauto-scrollplugins with theirdelay,speed,start-delay,direction,play-on-init,stop-on-interaction,stop-on-mouse-enter, andstop-on-last-snapoptions. Other Embla options are ignored, among themslides-to-scroll,contain-scroll,duration,breakpoints,active, andwatch-*. Theclass-namesplugin is gone: style thesnappedandin-viewstate tokens. - BREAKING
--ui-carousel-touch-actionand thedata-ui-draggingflag on:rootare removed. The pointer is captured during a mouse drag, so the grabbing cursor comes from the viewport'sdraggingstate alone. Slides no longer forcetransition: none. - Right to left needs no option: the track follows the inherited
dir(dropdata-carousel-direction).data-carousel-axis="y"now lays the track out vertically by itself; give the viewport a height.data-carousel-thumbs-axis="y"does the same for a thumb strip. - The arrow keys follow the track: Left and Right mirror in RTL, and Up and Down step a vertical carousel.
- Autoplay and auto-scroll pause while the carousel is off screen or the tab is hidden. Auto-scroll does not start on its own under
prefers-reduced-motion: reduce. A root that is playing carries theplayingstate token. - New hooks:
--ui-carousel-snap-align,--ui-carousel-settle-duration,--ui-carousel-settle-ease. - A slide that only touches the viewport's edge is no longer marked
in-view. - The viewport hides its scrollbar, scrolls smoothly unless
prefers-reduced-motion: reduceis set, and setsuser-select: nonewhile it can be dragged.
drawer
- New primitive: a bottom sheet on the native
<dialog>that is dragged down, or flicked, to dismiss.data-ui="drawer"is a drawer on every device, withdata-drawer-slot="handle | content | header | body | footer | close".data-ui="dialog drawer"is a dialog that becomes a drawer below thesmband on a touch screen and keeps its dialog slots. Scrolling content scrolls before the drawer moves, and the backdrop fades with the drag. Hooks:--ui-drawer-*. - Snap points:
data-drawer-snap="12rem 0.5 1"gives a drawer resting heights (a share of its height, or apx/remlength). It opens at the first, settles on the nearest, and a flick moves one stop;data-drawer-snap-sequentialstops a fast flick from skipping. The handle steps through them on click,zazz:drawer-snapreports each change,data-drawer-statecarriesexpandedorpartial, andsnapDrawer(dialog, index)moves it from script. - Stacked drawers: a drawer opened over another scales the one behind back and lifts it, and that one follows the front drawer's drag. Hooks:
--ui-drawer-stack-scale,--ui-drawer-stack-lift,--ui-drawer-nested-backdrop-color. - Page indent: wrap the page in
<ui-drawer-indent>(ordata-ui="drawer-indent") and it scales back behind an open drawer with rounded top corners, following the last drawer's drag. Onlyscaleandtranslateanimate. Hooks:--ui-drawer-indent-inset,-offset,-radius,-bg,-backing. While indented,position: fixedelements inside the wrapper move with the page. - The software keyboard: on a phone the keyboard covers the bottom of the screen without shrinking the layout a drawer is placed against. While a field in the front drawer has the keyboard up, the drawer's content ends at the keyboard's top edge (its surface runs on underneath, so no page shows below it), the focused field scrolls into the part still visible, and the page behind holds its scroll position. Nothing to author.
toaster
- Toasts swipe to dismiss, with a finger or the mouse: toward the edge they entered from, or sideways toward the nearest inline edge (either way when centered). A swipe of 45px or a quick flick dismisses; less returns the toast to rest. Timers pause during a swipe.
- Toast text is no longer selectable (
user-select: none), so a mouse drag swipes the toast and does not start a selection. - The toaster now loads
base/gesture.js.zazz-ui updatevendors it; a hand-written page that lists scripts one by one needs it too.
dialog
translateandscalejoin the<dialog>transition list, so a dialog moved with them (the drawer's drag, a drawer stacked behind another) eases back.- The phone size (
--ui-dialog-mobile-size) skips a dialog that is also a drawer. --ui-dialog-transition-delay--enddefaults to0ms(was150ms), so a dialog starts closing as soon as it is dismissed.
radio
- The checked dot is centered exactly. It used to sit up to a pixel off at fractional sizes, because its own box and mask tile snapped to the pixel grid separately from the circle. The dot is now a
radial-gradientdrawn over the whole circle, at the same size as before. - BREAKING
--ui-radio-dot-masknow covers the circle's whole padding box, not a--ui-radio-dot-sizebox. Migration: give a custom mask its own position and size, e.g.url(star.svg) center / 50% no-repeat. --ui-radio-border-color--checkeddefaults to--ui-field-border-color--hover(was--color-primary), and--ui-radio-dot-sizefollows--ui-radio-size(calc(var(--ui-radio-size) * 0.85)).
fields
- BREAKING
--ui-field-inset-child-radiusis now--ui-field-inset-radius. It is computed from the field it sits in (--ui-field-radiusminus--ui-field-inset-pand the border width) instead of--radius-sm, so inset parts stay concentric at any radius. Migration: rename the hook. - BREAKING
--ui-field-addon-pis now--ui-field-inset-p, and its default drops fromvar(--spacing)tocalc(var(--spacing) * 0.85). Input groups, password groups, the date picker button, and the tabs track all read it. Migration: rename the hook.
input-group
- Addons, the password toggle, and the calendar picker button use
--ui-field-inset-pand--ui-field-inset-radius.
password-group
- The toggle uses
--ui-field-inset-pand--ui-field-inset-radius.
input
--ui-input-calendar-picker-radiusdefaults to--ui-field-inset-radius.
tabs
- The track takes the field family's metrics:
--ui-tabs-track-pis--ui-field-inset-p,--ui-tabs-track-gapis--ui-field-gap,--ui-tabs-gapis--ui-field-option-gap, and the track and indicator borders read--ui-field-border-*. The indicator radius is the track radius minus the track padding, and--ui-tabs-indicator-insetdefaults to half the track padding, so the indicator sits just inside the checked label.
switch
- The thumb has a border in the field colors (it was transparent), and the checked track's border uses the field border colors instead of the track fill.
slider
- The thumb is filled with
--color-primary(was--color-card), with a--ui-field-border-colorborder.
button
--ui-button-background-clipdefaults toborder-box(waspadding-box), so a translucent border sits over the fill instead of the page.
tooltip
- The tooltip is outlined instead of shadowed: new
--ui-tooltip-border-width(1px) and--ui-tooltip-border-style(solid),--ui-tooltip-border-colordefaults to--color-background, and--ui-tooltip-shadowtonone. Border utilities on the content apply to the arrow too. - The arrow is hidden by default. Set
--ui-tooltip-display: blockto show it. It is square with only its tip rounded (--ui-tooltip-arrow-radius, default0), it continues the content's border, and it points the right way in RTL. - The text uses the mono family (
--ui-tooltip-font-family), and the new--ui-tooltip-font-settingshook sets its variation settings.
Install: npm install @zazz-ui/core@0.14.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
zazz-ui CLI 0.3.3
- An exact version (
update @0.14.1,diff @0.14.1,init 0.14.1) resolves right after it is published. The CLI reads an exact version from npm's cache, and when the cached version list predated the release, it reported "No matching version found" until something like@latestrefreshed the list. A cache miss now asks the registry once.--offlinestill never goes online. - The README lists
@zazz-ui/core0.1 through 0.14 as supported.
Run with npx zazz-ui@0.3.3 (or pnpm dlx zazz-ui@0.3.3). Full history in packages/cli/CHANGELOG.md.
@zazz-ui/core 0.13.1
input
- A full-width date, time,
datetime-local, month, or week input no longer overflows its container in iOS Safari. The iOS correction for WebKit's sizing bug subtracted the field's padding and border but not the extra inline padding a touch screen adds to reach the touch-target height.
Install: npm install @zazz-ui/core@0.13.1, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.13.0
base
- BREAKING Tiers with no use are gone, which takes about 10 KB off the built CSS (1 KB gzipped). The editor and
<ui-debug>report each one as a tier the utility does not take. Migrate as follows:--isolation,--font-family, and--font-styletake no breakpoints. Set the base value.--border-styletakes no breakpoints. A border that changes with width changes its width:--border--md: 0or--border-width--md.--container-nametakes no breakpoints. Name the container at the base and switch it on with--container-type--md, or put the name in the shorthand (--container--md: panel / inline-size).--shadow-angletakes no states.--shadow--hoveror--elevation--hoverchanges one element's shadow;--shadow-angle--mdstill works.- No
--startingtier where it had no practical use: on--transition,--transition-duration,--transition-delay,--animation,--anchor-name,--position-anchor,--position-area,--text-wrap,--text-decoration,--border-style,--mix-blend, and--z. Delete the declaration.
- BREAKING
--grid-cols: subgridand--grid-rows: subgridare gone: subgrid is a display.--display: subgridtakes both axes' tracks from the parent grid,--display: subgrid-colthe columns, and--display: subgrid-rowthe rows; each takes breakpoints, and the axis it does not take keeps its own--grid-colsor--grid-rows. Across breakpoints the highest tier that names a display or a count decides. Migrate--display: grid; --grid-cols: subgridto--display: subgrid-col, both axes to--display: subgrid, and a tier (--grid-cols--md: subgrid) to--display--md: subgrid-col; the editor andvp run lint:htmlsuggest the rewrite.--template-cols: subgridand--template-rows: subgridwork as before. --display: grid-galleryis a grid that picks its column count from its child count: as many as fit in a row, up to six, each at least--ui-gallery-min-wwide (20chby default), skipping a count that would leave one child alone in the last row. It takes breakpoints (--display: flex-col; --display--md: grid-gallery).
carousel
- BREAKING The carousel runs on Embla v9 (
9.0.0-rc04, pinned in the import map with new SRI hashes; update a hand-written import map to match). Core options pass straight through, so rename any v8 option attribute: thestartIndexoption isdata-carousel-start-snap,-watch-drag→-draggable,-watch-resize→-resize,-watch-slides→-slide-changes,-watch-focus→-focus.data-carousel-start-indexstays the kit's own dialog attribute (don't set it by hand).data-carousel-drag-free="snap"anddata-carousel-in-view-marginare new. On Autoplay,data-carousel-autoplay-jumpis now-instant; on Class Names,data-carousel-class-names-draggingis now-pointer-down. Code that calls_emblaApi/<ui-carousel>.apiuses the v9 names:goTo,goToNext,goToPrev,canGoToNext,canGoToPrev,selectedSnap,snapList, and lowercase events (reinit,pointerdown,slidesinview);initis gone. - Autoplay and Auto Scroll keep the kit's documented behavior, which the kit now implements itself because Embla v9 dropped the options. They play on init, and a drag or slide focus stops them. With
data-carousel-autoplay-stop-on-interaction="false"(or-auto-scroll-), a drag or focus holds them and they resume after.-play-on-init="false"still leaves the plugin stopped.-stop-on-mouse-enterand-stop-on-focus-inare gone. A playing plugin keeps playing after a resize or breakpoint change, which re-creates it; on its own, v9 would leave it stopped. One change from v8: once an interaction has stopped a plugin, a resize no longer restarts it.
tabs
data-tabs-variant="underline"draws tabs without a track: the indicator is a 2px line under the checked label, or at its start edge withdata-tabs-orientation="vertical", and the labels use--font-size-md.--ui-tabs-underline-widthand--ui-tabs-underline-colorset the line.- Tabs nested in a panel no longer hide the outer tabs' panels. The panel rules matched any tab list inside the root; they now match only the root's own list.
toggle
- A disabled toggle with a variant keeps that variant's color, at 60% opacity as on the button. Every disabled toggle used to take the muted surface at 50%; now only the default one does.
- The
primary,secondary, andtertiaryvariants hover and press with the button's lightness steps. They used to fade the fill to 90% and 80% alpha.mutedfades toward the surface beneath, andghostdeepens its hover fill on press. - The checked border is
--color-border(was--color-primary), and the fill paints under it:--ui-toggle-background-clipdefaults toborder-box, and--bg-clipoverrides it per element. - A
<kbd>in a toggle takes the compact key size, and one at either end of the content (a kbd group too) tightens that side's padding, as on the button. data-toggle-size="sm"uses--font-size-xs, and the cursor isdefaultto match the button.
utilities
- New example fragments for the display keywords:
gallery,subgrid,subgrid-col,subgrid-row,flex-reverse, andinline-flex.
debug
--grid-cols: subgridand--grid-rows: subgridare reported undernot-integer, with a suggestion that folds the keyword into the element's--display.- The
tier-unsupportedwarning names the utility, where it named the family: "--z--mduses a tier--zdoes not take".
Install: npm install @zazz-ui/core@0.13.0, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.12.3
slider
- The track fill moves again in Chromium and Safari. In 0.12.2's built
dist/zazz.cssthe minifier folded the fill's named timeline into theanimationshorthand, which browsers reject, so the fill stayed at the start. Only the built file was affected (CDN links and the package'sstyleentry);@zazz-ui/core/index.cssimports andzazz-uivendored copies use the source and were fine.
switch
- The thumb takes a border:
--ui-switch-thumb-border-widthand--ui-switch-thumb-border-styledefault to the field's, and--ui-switch-thumb-border-color,--ui-switch-thumb-border-color--hover,--ui-switch-thumb-border-color--checked, and--ui-switch-thumb-border-color--checked-hoverdefault totransparent. - The track is one border width taller, so the gap around the thumb is the same on every side, on and off. The thumb casts
--shadow-xs(was--shadow-sm).
Install: npm install @zazz-ui/core@0.12.3, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.
@zazz-ui/core 0.12.2
base
--color-inputin dark mode is the solid--color-neutral-950, where it was the--color-tint-100overlay.- A padding tier written without its base (
--px--md: 4with no--px) no longer applies to a slider, so it can't override the inline padding the slider's fill depends on.
fields
- A field's hover border mixes 10% of
--color-foregroundinto the border, where it mixed--color-primary.
slider
- The track takes the field look:
--ui-slider-track-bg,--ui-slider-track-border-width, and--ui-slider-track-border-colordefault to the matching--ui-field-*hooks, where they were--color-mutedwith a 1px muted border. The thumb is--color-card(was--color-background). - The track fills from the start to the thumb in
--color-primary. Set the color with--ui-slider-fill-bg, and fill from the thumb to the end instead with--ui-slider-fill-side: end. - In Chromium and Safari, the fill needs the input to clip its overflow. A slider used with a mouse is now about 30px tall, and its track ends sit 3px in from each side to leave room for the focus ring. A thumb shadow larger than the default gets clipped, and padding utilities on the slider move the fill off the thumb.
- Right-to-left sliders have no fill in Chromium or Safari, because the two engines disagree on which way it should run. Firefox fills them.
tabs
- The indicator is
--color-mutedwith no shadow (--ui-tabs-indicator-bg,--ui-tabs-indicator-shadow), where it was--color-cardwith--shadow-xs. - The track is tighter:
--ui-tabs-track-pand--ui-tabs-track-gapare0.35 * --spacing(were0.5), and--ui-tabs-gap, between the tab list and the panels, is0(was--space-xs).
tooltip
- An opening tooltip no longer flashes far from its trigger in Chromium when the page or a container around it is scrolled. Chromium misplaces one of the first two frames, so the opening fade now starts 34ms late and that frame is transparent. Closing is unchanged. A custom
--ui-tooltip-transitiongets the delay on its first entry.
Install: npm install @zazz-ui/core@0.12.2, or npx zazz-ui update in a project that already vendors the kit. Full history in packages/core/CHANGELOG.md.