Skip to content

v1.36.0: your CSS wins, buttons submit, switches start off

Choose a tag to compare

@robritacca-dotcom robritacca-dotcom released this 24 Nov 02:35
· 128 commits to main since this release

Your own CSS now always beats component styles, in development and production alike. This release also fixes deep imports that type-checked but failed to build, lets buttons submit forms, and starts a ToggleSwitch off. Nothing published was removed; three changes in behaviour are listed under Changed.

Changed

  • Component styles sit in a cascade layer. Every component stylesheet now opens with @layer rift.tokens, rift.preset, rift.components; and keeps its rules in rift.components, after the token layers. Any CSS of yours outside a layer beats them, whatever its selector and whatever order your bundler loads the sheets in, so an override that worked under next dev no longer disappears under next build. className is the supported hook. If you relied on a library rule beating your own CSS, yours now wins.
  • A reset of your own now outranks the components too. A bare * { margin: 0; padding: 0 } would strip their spacing. Put a reset inside @layer rift.tokens { … }, or import rift-ds/tokens/base.css, which already sits there (as do the icon sheet's class rules).
  • ToggleSwitch starts off. defaultChecked now defaults to false, as every other checkable control does, so a switch left uncontrolled no longer turns its setting on by itself. A switch that relied on starting on needs defaultChecked.

New

  • type on Button, IconButton and SplitButton: 'button' | 'submit' | 'reset', defaulting to 'button', so a button inside a form still never submits it by accident. type="submit" makes it the form's submit button. A loading button is disabled, so it cannot submit twice. On SplitButton it reaches the primary segment only; the menu chevron never submits.

Fixed

  • Deep imports ship every value their types declare. fieldErrorsFrom from rift-ds/components/ErrorSummary/ErrorSummary, periodColumns, periodsOf and totalOf from DataTable, BLOB_COUNT from ShaderField, and revokeAttachmentUrls and useAttachments from AttachmentGroup type-checked but failed a production build with a missing export. The settings block from init block settings hit it.
  • Floating panels are opaque in dark mode. FilterBar's option panel, Link's skip link and AppSidebar's phone trigger let the page show through. They now take the opaque menu fill, which in light mode moves FilterBar's panel from white to the page grey, as Dropdown's menu is.
  • A ToggleSwitch that is off looks off: a neutral track and thumb, and no tick.
  • AppSidebar marks one current page. With a sub-item current, its parent no longer carries aria-current as well, and it gives up its fill while the sub-item shows below it.
  • A bare Chart takes no padding on a phone, and a compact Input with an icon and a prefix, suffix, clear button or action no longer pads its text for the icon.
  • A clearable search Input shows one clear button, not the library's and the browser's side by side.
  • Table's total row shows its rule.
  • Stat's arrow sits on a wrapped delta's first line.
  • AppSidebar's collapse, profile and phone-trigger buttons show the focus ring.

Blocks

  • The settings and sign-in blocks submit through their buttons. If you copied them earlier, give the Save profile and Sign in buttons type="submit" and drop their onClick.
npm install rift-ds@1.36.0