Back to the changelog
v3.11.0

Check and inspect your config

A config is easier to trust when you can ask it questions. This release adds two CLI commands for that: one lists what your config registers, and the other finds what's wrong with it, without writing a file. A coding agent gets the same answers you do. The release also brings twelve recipes in line with their Open Components standards, so their text and borders keep their contrast in both themes, and the ones you can focus share one focus colour.

New

  • A check command. Run styleframe check to validate your config without building it. It exits with 1 when it finds a problem or the config file doesn't exist, so it can stop a CI job or tell an agent to try again. Add --json for one { "ok", "diagnostics" } document on stdout, and --typecheck to run your project's tsc on the entry file too, which needs the typescript package installed.
  • An inspect command. Run styleframe inspect to list the variables, themes, utilities, modifiers and recipes your config registers, or one section of them, like styleframe inspect recipes. Add --json to get them as one document. In code, the new inspect(instance) function returns the same snapshot.
  • A guide for AI agents. Using Styleframe with AI agents covers the loop of check, inspect and strict builds, and the mistakes that build without a warning. Nine packages that shipped without a README now have one, and each links to the guide.
  • Card media, icon-only buttons and growing textareas. The new useCardMediaRecipe puts an image at the top of a card. Buttons gain icon sizes and an icon-only style: a button with data-icon-only and data-size turns square and hides its label from view, but keeps it as the accessible name. Textareas gain an autogrow axis, which grows the field with its text in browsers that support field-sizing.
  • Placement for tooltips and popovers. Both gain a placement axis (top, bottom, start or end), which defaults to top. On an element with the popover attribute, they open in the top layer beside their trigger and flip to the other side when there's no room.
  • A focus colour and five modifiers. The new color.focus token colours focus rings. It points at @color.primary, so nothing changes until you set it. The new hover-capable, any-pointer-coarse, aria-invalid, readonly-attr and data-loading modifiers come with a position-try-fallbacks utility.

Improved

  • Twelve recipes meet their standards. Button, Card, Checkbox, Checkbox Group, Input, Modal, Popover, Radio Group, Spinner, Switch, Textarea and Tooltip now follow their Open Components pages. Where their standards ask for it, labels keep 4.5:1 contrast and borders and tracks keep 3:1, in both themes. Hover styles apply only on devices that can hover, and buttons, inputs, textareas, radios and switches get a 44px hit area on touch screens. Most of them also draw in system colours in forced colours mode and at full strength with prefers-contrast: more. Recipe names, axes, values and defaults stay the same, apart from the additions in this entry.
  • Buttons show every state. Buttons take their disabled, pressed, expanded and loading looks from aria-disabled, aria-pressed, aria-expanded and data-loading as well as :disabled. A disabled button no longer sets pointer-events: none, so its cursor shows and clicks don't fall through to what's behind it.
  • Modals fit the screen. A modal panel stays 1rem inside the edges of the screen and caps its width per size, so you can drop any max-width you set yourself. Its body scrolls while the header and footer stay put, and the page stops scrolling behind a modal-overlay.
  • Spinners match their text. The new inherit size makes a spinner 1em wide and tall and lines it up with the text around it. With reduced motion, it pulses instead of turning.
  • No hover on tap. Link hover styles from useLinkElement now apply only on devices that can hover, so tapping a link, or a button rendered as <a href>, no longer leaves it looking hovered.

Fixed

  • The separator in a date input takes the field's muted text colour on light and dark fields, and @color.gray-400 on neutral fields in the dark theme. Its dark-theme rule used a :dark pseudo-class that no browser matches.

Notes

  • This release leaves the styleframe package at 3.9.2. To get the new commands, inspect() and the recipe changes, update @styleframe/core, @styleframe/cli and @styleframe/theme, which all work with styleframe 3.9.2.
  • The styleframe build command prints a warning for each problem it finds and exits with 1 when the build fails, where it used to exit with 0. With strict: true, it writes nothing and exits with 1 when it finds a problem.
  • The bundler plugin logs each problem as a warning once per build, so you may see warnings you didn't see before. With strict: true, it fails the build.
  • Render a modal-overlay only while its modal is open. The page can't scroll while an overlay is in the document, even a hidden one, so an overlay you keep mounted and hide, like with v-show, now locks the page.
  • Cards no longer set overflow: hidden, so an image you put in a card yourself loses its rounded corners. Put it in useCardMediaRecipe, which rounds its own, or clip it yourself.
  • CSS can't tell which side a tooltip or popover flipped to, so when one flips, set its arrow's placement from a script.
  • The Spinner circle uses the motion-reduce modifier, so register it first, as useModifiersPreset does.
View the v3.11.0 release on GitHub