Repository navigation
@chassis-ui/css v0.6.0
Added
@chassis-ui/css/tailwind/merge.js: the grid classes are now part of the generated tailwind-mergeclassGroupsconfig, sotwMerge('col-6', 'col-4'),twMerge('g-md', 'g-lg'),twMerge('offset-2', 'offset-4'), and therow-cols-*,gx-*,gy-*,g-col-*,g-start-*equivalents resolve to the last classNav:.smand.lgsize modifiers on.nav, for the base nav and the tabs, segments, and underline variants. They scale the link padding, gap, icon size, caret size, and font from Chassis Tokens; segments also scale the bar padding and corner radius, and underline scales the gap between links. Without a modifier the medium size applies@chassis-ui/css/postcss: the preset now has type declarations, so a TypeScript PostCSS configuration getschassisPrefix(),chassisPostcss(),mergeLayerBlocks, and theChassisPrefixOptionstype checkedpackage.jsonis now an export (@chassis-ui/css/package.json), for the tools that read a package's version or fieldsNav:.nav-linkis now a centered flex row with a gap, so an icon placed inside the link aligns with the label and scales with the nav size. New--cx-nav-link-gap,--cx-nav-link-icon-size,--cx-nav-link-caret-size, and--cx-nav-link-caret-spacingcustom properties, and--cx-nav-segments-idle-fg-color/--cx-nav-segments-idle-bg-colorfor the idle segment links
Changed
- Breaking: JavaScript entry:
import { Tooltip } from '@chassis-ui/css'now resolves to compiled JavaScript (js/dist/index.js) with type declarations (js/dist/index.d.ts), instead of the TypeScript source (js/index.ts). Node.js could not import the source fromnode_modules, a bundler had to compile it, and a TypeScript project checked it with its own compiler options: a strict project got 209 errors from 0.5.0. Imports from@chassis-ui/cssand from@chassis-ui/css/js/dist/*need no change.@chassis-ui/css/js/src/*is no longer an export; import the module from@chassis-ui/css/js/dist/instead (js/dist/tooltip.jsforjs/src/tooltip.ts).js/index.tsmoved tojs/src/index.ts, so a bundler alias that names the file by its path needs the new path,js/dist/index.js - Source maps no longer hold a copy of their sources. They name the Sass files in
scss/and the modules injs/src/, which the package ships, so the browser's developer tools show the same source as before when the package is installed from npm or loaded from a CDN that serves the whole package. The installed package is 7.2 MB instead of 14.4 MB. Two kinds of source are not in the package and no longer show: the Chassis Tokens file the CSS is compiled with, and the dependencies insidechassis.bundle.js. A copy ofdist/alone, withoutscss/andjs/src/next to it, shows no source package.jsondeclaresengines.node>=22, the version the PostCSS preset and the Sass build are tested with. The CSS and the JavaScript in the browser are not affected- Tailwind entry: grid column, offset, gutter, and CSS grid placement classes (
col-6,md:col-4,lg:offset-2,g-md,g-col-4, …) are now Tailwind@utilityrules, so a Tailwind build only generates the ones a project uses, at the breakpoints it uses them, instead of every class at every breakpoint. Class names are unchanged; grid class names built at runtime need an@source inline(...)safelist entry. The classes sit in alayoutsublayer of Tailwind'sutilitieslayer, so utilities still override them at every breakpoint (w-100 md:col-6stays full width). Two results differ from 0.5.2: withg-*andgx-*/gy-*on one element the axis-specific class now wins (g-md gx-0has no horizontal gutter), and grid classes now rank above thecontent,components, andhelperslayers instead of below them.dist/cssis unaffected - Sass: the Tailwind entry's mixins moved from
scss/mixins/toscss/tailwind/mixins/, andscss/mixinsno longer forwardsgenerate-tailwind-utilities,generate-tailwind-merge-manifest,emit-source-config, or the Tailwind grid mixins. Only affects projects that called these directly fromscss/mixins; the documented@chassis-ui/css/scss/tailwindentry is unchanged - Breaking:
Nav:.nav-pillsrenamed to.nav-segmentsand.card-header-pillsto.card-header-segments, with no aliases; the--cx-nav-pills-*custom properties are now--cx-nav-segments-*. The variant is restyled as a segmented control, with its colors, padding, corner radius, font, and shadow resolved from Chassis Tokens - Breaking:
Nav: the Sass variables are now size-specific.$nav-link-padding-y,$nav-link-padding-x, and$nav-link-fontare replaced by$nav-link-{small,medium,large}-*;$nav-tabs-border-widthby$nav-tabs-main-border-width;$nav-tabs-border-radiusby$nav-tabs-medium-border-radius;$nav-underline-gapby$nav-underline-{small,medium,large}-gap; and every$nav-pills-*variable by a$nav-segments-*one. A@use ... with (...)that configures a removed variable no longer compiles Nav: the active link's default colors now resolve from--fg-active/--bg-active(previously--fg-main/--bg-even), and a pressed link (:active) no longer takes the active link's styleNav: a.nav-linkwhose menu is open now keeps its hover style in every variant;.nav-tabsand.nav-pillspreviously gave it the active styleNav:.nav-underlinelinks no longer show the underline on hover and keyboard focus; only the active link is underlined- Docs: the
Navpage is rewritten to the style guide's standard section order, with new sections for size variants, icons, Sass variables, and design tokens
Fixed
Nav: opening a menu from a toggle placed directly inside a.nav-pillsnav, without a.nav-itemwrapper, gave every sibling link the active style, because the open state was matched on the toggle's parent. It is now matched on the toggle itself- Docs: the vertical example on the
Tabpage used.nav-pills-verticaland.me-4, neither of which exists, so the links never stacked; it now uses.flex-columnand.me-md. TheNavpage's link to the Tab plugin pointed at an anchor that does not exist - Types: 16 of the type declarations in
js/dist/were older than their modules, because the build did not write them.NavOverflow'smoreText: string | falseand thenullaTogglervalue can hold were missing, among others. The build now writes the declarations with the modules, and a release fails when any file indist/orjs/dist/differs from a fresh build
Minor Changes
-
b60c264: Breaking:
.gridis the grid system of Chassis, with gutters, column counts and container padding from the design tokens per breakpoint. The flexbox grid is deprecated.- Placement classes with Tailwind's names and declarations, generated for every breakpoint:
col-span-{1…12},col-span-full,col-start-{1…13},row-span-{1…6}androw-start-{1…7}, withcol-start-autoandrow-start-autoto reset a start line at a wider breakpoint.g-col-{n}andg-start-{n}keep working as second selectors ofcol-span-{n}andcol-start-{n}, deprecated. The declaration ofg-col-{n}is nowgrid-column: span n / span ninstead ofauto / span n: the same placement, unless an element setsgrid-column-enditself. - The gap of
.gridand.grid-fillis the gutter token of the breakpoint,--cx-grid-gutteron:root(0.5rem atxsto 3rem at2xl, from$grid-gutters), where it was$grid-gutter-x(1.5rem) at every width.--cx-grid-gapon an element still sets the gap of one grid. The tracks areminmax(0, 1fr), so content no longer widens a column..grid-filltakes--cx-grid-minas the minimum column width. - The column count comes from
$grid-column-counts(--cx-grid-columnson:root, 12 at every breakpoint until the Figma library defines the counts).grid-cols-{1…12}are utilities with Tailwind'srepeat(n, minmax(0, 1fr));grid-cols-fillis deprecated in favour ofcol-span-full. - The padding of
.containeris--cx-container-paddingfrom$container-paddings, the page margin per breakpoint, independent of the gutter (0.75rem at every breakpoint, today's value). A--cx-gutter-xset on a container still works until 0.7.0.$container-padding-xis deprecated: when a project sets it, half of it is the padding at every breakpoint, as before, and the build warns. - In the Tailwind entry, the placement classes are Tailwind core's own
col-span-*,col-start-*,row-span-*androw-start-*utilities: the entry no longer emits grid placement rules of its own, only the deprecatedg-col-*andg-start-*aliases, which now carry the declarations of the classes they alias and sit in theutilitieslayer with them instead of theutilities.layoutsublayer. In@chassis-ui/css/tailwind/merge.jsthe aliases join tailwind-merge'scol-start-endandcol-startgroups, socol-span-4 g-col-6resolves to one class. - Responsive fraction widths
w-{1…11}/12(md:w-6/12), the names and values of Tailwind'sw-<fraction>, replacecol-{n}used as a width outside a.row, as on skeletons;w-100,w-autoandflex-fillreplacecol-12,col-autoandcol. - Deprecated as of 0.6.0, removed in 0.7.0: the flexbox grid (
.row,.col-*,.offset-*,.row-cols-*,.g-*,.gx-*,.gy-*), its mixins (make-row(),make-col-ready(),make-col(),make-col-auto(),make-col-offset(),row-cols(),make-grid-columns()) and its variables ($grid-gutter-y,$grid-row-columns,$gutters). The build warns once per compile while$enable-grid-classesis true; set it tofalseto drop the flexbox grid now, or$enable-deprecation-messages: falseto silence the notice. Migrate.rowto.grid,.col-4to.col-span-4,.offset-2to.col-start-3,.md:offset-0to.md:col-start-auto,.row-cols-3to.grid-cols-3,.g-mdto.gap-md,.gx-*and.gy-*to.column-gap-*and.row-gap-*. - The grid bundle (
chassis-grid.css) declares the--cx-space-*custom properties its gap and gutter classes read.
- Placement classes with Tailwind's names and declarations, generated for every breakpoint:
Patch Changes
-
e58ef47: Fix the defects the end-to-end tests found in Dialog, Combobox, Menu and Datepicker.
- Dialog: Escape pressed repeatedly no longer closes a dialog with
data-cx-keyboard="false", and a dialog the browser closes by itself releases the scroll lock of the page and fireshidden. A non-modal dialog is centered in the viewport. - Combobox: ArrowDown and ArrowUp on a closed menu leave the focus on the first or the last item. Escape in the input closes the menu. Tab on an item moves on to the next control in Safari.
- Combobox, Menu: the arrow keys wrap at the ends of the list, as documented.
- Menu: Escape closes the menu when a click left the focus on the page, as Safari does.
- Datepicker:
show,shown,hideandhiddenalso fire when the calendar opens on a click on its input and closes on Escape or a click outside. The focus returns from the calendar to its trigger when the calendar closes.
- Dialog: Escape pressed repeatedly no longer closes a dialog with
-
e58ef47: Build the CSS with
@chassis-ui/tokens0.6.0. Half-pixel values keep their full precision:0.03125reminstead of0.0313remin--cx-border-width-sm,--cx-border-width-lg,--cx-box-shadow-smand the shadows and letter spacing built on them. -
5c1cbfe: Rebuild the JavaScript with rolldown 1.2.12. The modules run the same code: a nested
ifnow has its braces, and the lastcaseof aswitchno longer ends with abreak. The minified builds do not change. -
cce6918: Rebuild the minified CSS with lightningcss 1.33, which collapses
light-dark()calls whose two values are the same. -
c7e01b9: Build
chassis.bundle.jswith@floating-ui/dom1.8.0, which positions a floating element against ascrollbar-gutter: stableviewport and a left-side scrollbar correctly. The peer dependency range stays^1.7.6.