Skip to content

Type to search the docs, API, and blog.

↑↓ navigate↵ openesc close
  • Zazz 0.17 alpha

    Zazz 0.17 alpha

    Zazz 0.17 alpha gives the slider, progress bar, and meter one shared track, splits the switch thumb's scale by state, and fixes the spacing of buttons inside input groups on touch screens.

    Zazz 0.17 alpha is a small release about tracks and touch spacing. The slider, progress bar, and meter now draw the same track from one set of tokens. The switch thumb gets a scale for each state. A button inside an input group keeps its spacing on a phone. One change breaks themes that styled the meter through the progress hooks; the migration note at the end covers it.

    One track for three controls

    The slider, progress bar, and meter each drew a track and a filled part, and each had its own defaults. They were close but not the same: the progress bar had a 1px border the slider didn't, and its ends were always round where the slider followed the field shape.

    In 0.17 all three read a new family in fields.css:

    :root {
      --ui-field-track-h: …;
      --ui-field-track-bg: var(--color-muted);
      --ui-field-track-border-width: 0px;
      --ui-field-track-radius: var(--radius-full);
      --ui-field-track-corner-shape: var(--ui-field-corner-shape);
      --ui-field-track-fill-bg: var(--color-primary);
    }

    Set one of these and all three controls follow. Each control's own hooks (--ui-slider-track-h, --ui-progress-bg, --ui-meter-radius, and the rest) still work and still win.

    A new base token, --track-h-coefficient, scales every track's height at once. 2 doubles them, minimum height included.

    The progress bar and meter now take the field corner shape, which is a superellipse by default. Set --ui-progress-corner-shape: round or --ui-meter-corner-shape: round to keep pill ends.

    The slider thumb changes too: it's now a card-colored disc with a border in the fill color, where it was a solid primary disc.

    A scale for each switch state

    The switch thumb grows on hover and shrinks a little when pressed. Through 0.16 the states did this by overwriting --ui-switch-thumb-scale, so a value you set on it held at rest and was replaced on hover. 0.17 adds a hook per state:

    :root {
      --ui-switch-thumb-scale: 1;
      --ui-switch-thumb-scale--hover: 1.1;
      --ui-switch-thumb-scale--active: 0.98;
      --ui-switch-thumb-scale--checked: 1;
      --ui-switch-thumb-scale--checked-hover: 1.1;
      --ui-switch-thumb-scale--checked-active: 0.98;
    }

    --ui-switch-thumb-scale is now the unchecked resting scale and nothing else.

    Buttons in input groups on touch screens

    On a touch screen an input group grows to the 44px touch floor. A button in one of its addons stayed at its desktop height, so it sat in the middle of a taller box with extra space above and below. In 0.17 the button grows with the addon and keeps the same inset from the edge it has on a mouse. Its side padding grows by half of what the height grew, the way a standalone button's does. The same applies in the password group.

    A new token, --ui-field-kbd-px, sets the padding on the side of a button or toggle that ends in a <kbd>. It gets the same touch-screen growth.

    Migrating

    • The meter no longer reads the --ui-progress-* hooks. If a theme set --ui-progress-h (or -radius, -corner-shape, -bg, -track-border) to restyle both bars, set the matching --ui-meter-* hook too, or set the --ui-field-track-* token to restyle the meter, progress bar, and slider together.
    • Progress bars and meters change shape and may get a little taller: they follow the field corner shape and the track's minimum height. Set their corner-shape hooks to round to keep the old ends.