Repository navigation
@chassis-ui/css v0.7.0
Minor Changes
-
1a54d5d: Container-query variants of the grid classes and the layout utilities, and a grid whose gutter follows its container.
@md:variants. Every placement class of.gridhas a variant per container width under the@prefix, Tailwind's container variant:.@md:col-span-4,.@lg:col-start-3,.@md:col-end-13,.@md:col-auto,.@md:row-span-2. It applies when the nearest query container (.contains-inline,set-container(), a.navbar) is at least as wide as the breakpoint, where.md:col-span-4follows the viewport. The prefixes are@sm:to@2xl:; an unprefixed class is the layout belowsmand of an element with no query container above it. Where a breakpoint class and a container class both apply to an element, the container class wins- The layout utilities have the same variants:
d-*,flex-*,order-*,justify-content-*,align-items-*,align-content-*,align-self-*,gap-*,row-gap-*,column-gap-*,place-items-*,place-content-*,place-self-*,justify-items-*,justify-self-*,grid-cols-*,grid-rows-*,grid-flow-*,auto-cols-*,auto-rows-*,space-x-*,space-y-*,divide-x,divide-y,w-{n}/12,w-100,w-auto,text-start/text-center/text-end,float-*andobject-fit-*(.@md:d-flex,.@md:flex-row,.@md:w-6/12) .grid.containedand.grid-fill.containedtake--cx-grid-gutterand--cx-grid-columnsfrom the breakpoint of the query container, not of the viewport: a grid in a narrow column of a wide page has the gutter of a narrow page.--cx-grid-gap, a gap utility andgrid-cols-*still override them, and without a query container above it the grid keeps the values of the viewport, as a plain.griddoes: the first breakpoint's values are declared in@container (width >= 0), which matches any container and nothing else. Plain.gridis unchanged- Utilities API: a
containerkey, boolean.container: truegenerates the@variants of a utility, after its responsive ones. The utilities above set it; margin, padding, font size and icon size setcontainer: false, and amap.mergeof$utilitiesturns it on for them - Sass: the option
$enable-container-queries(trueby default) governs the@variants and the modifier. New:container-breakpoint-prefix(),make-cssgrid-container()andgrid-container-vars() - Tailwind entry: nothing new to import.
@md:col-span-4and@md:d-flexare Tailwind's own container variants there, at the Chassis breakpoints, for every utility;.grid.containedis plain CSS of the entry chassis.min.cssis 693 KB, from 628 KB in 0.6.0 (84.5 KB gzipped, from 78.6 KB): 20 KB less for the flexbox grid, 85 KB more for the new grid classes at six breakpoints and for five container widths of 63 placement rules and 217 utility rules.$enable-container-queries: falseleaves the container widths out. The grid bundle is 206 KB, from 156 KB (21.9 KB gzipped, from 16.9 KB), with the utilities it gained
-
789615b: Fixes from a review of the grid system.
.grid-fillwraps without a minimum set. Its columns are at least12remwide ($grid-min, the fallback of--cx-grid-min), where the minimum of0put every child in one row, whatever their number.--cx-grid-minstill sets the width of one grid. In a grid narrower than the minimum, the one column that fits takes the width of the grid instead of overflowing itplace-items-*has a variant per breakpoint and per container width (.md:place-items-center,.@md:place-items-center), which its documentation described and the build did not generate- The grid bundle (
chassis-grid.css) has.contains-inline, without which its.containedmodifier and@md:classes had no query container to read, and the fraction widths (.w-6/12) with their variants. Its utility list named ajustify-itemskey that does not exist;map-get-multiple()now warns about a key the map lacks grid-root-vars()andgrid-container-vars()check their maps. A map with no value for the first breakpoint ($grid-gutters: (md: 1.5rem)) stops the compile, where it left--cx-grid-gutterundefined belowmd; a key that is no breakpoint is reported with a warning and ignored, as beforetailwind/merge.jsexportsoverrideClassGroups. tailwind-merge listsgrid,table,inline,list-item,collapseandstaticin its display, visibility and position groups, and in the Tailwind entry they are Chassis classes, sotwMerge('grid gap-md', 'd-flex')dropped.grid. Passoverride: { classGroups: overrideClassGroups }besideextend: { classGroups }toextendTailwindMerge, and the Chassis class staysNavbar: the rule of a container inside a.navbarlisted.sm\:containerto.2xl\:container, classes that do not exist (the variants are.container.sm, which.navbar > .containermatches). The selectors are removed- Tailwind entry: with those selectors gone,
sm:containerto2xl:containerare no longer names of Chassis classes, and the entry no longer excludes them from Tailwind:lg:containeris Tailwind's owncontainerutility under itslg:variant, where it generated nothing.containeralone stays the Chassis class
-
588e601: The rest of the grid vocabulary, under Tailwind's names and with its declarations, each with a variant per breakpoint and per container width.
- End lines:
.col-end-{1…13}and.col-end-auto(grid-column-end),.row-end-{1…7}and.row-end-auto..col-span-3 .col-end-13places three tracks against the end edge of the grid. They are generated one line past$grid-columnsand$grid-rows .col-autoand.row-auto(grid-column: auto,grid-row: auto) take a span and a line off an item at a breakpoint:.col-span-full .md:col-auto..col-autowas a class of the flexbox grid until this release; markup that still carries it gets an item of one track- Tracks:
.grid-cols-none,.grid-rows-noneand.grid-rows-subgrid, and.auto-cols-{auto,min,max,fr}and.auto-rows-{auto,min,max,fr}for the size of the tracks a grid adds beyond its template (grid-auto-columns,grid-auto-rows) - Alignment:
.justify-items-{start,end,center,stretch},.justify-self-{auto,start,end,center,stretch},.place-self-{auto,start,end,center,stretch}and.place-content-{start,end,center,between,around,evenly,stretch} - Sass:
$grid-min, the minimum column width of.grid-fill(12rem) and the fallback of--cx-grid-min, beside$grid-columnsand$grid-rows;@chassis-ui/tokenshas no token for it yet - Tailwind entry: nothing changes for a project that used Tailwind's utilities of these names. The end lines and the
autoresets are Tailwind's own; the track and alignment utilities are Chassis utilities equal to Tailwind's, in the groups of tailwind-merge of the same names (grid-flow,auto-cols,auto-rows,justify-items,justify-self,place-content,place-self) - The grid bundle (
chassis-grid.css) has all of them
- End lines:
-
69f7c98: Breaking: the page margins and the column counts of the grid come from
@chassis-ui/tokens, and the compiled CSS has the values of tokens 0.7.0: wider page margins, new gutters, and lighter text colors in the dark theme.$margin-xsmallto$margin-2xlargeand$columns-xsmallto$columns-2xlargeofscss/tokens/_grid.scssread$cx-grid-margin-*and$cx-grid-columns-*, where they held.75remand12. A project that compiles the Sass needs@chassis-ui/tokens0.7.0 or later, and a token source of its own (_chassis-tokens.scss) needs the twelve variables: without them the compile stops at an undefined variable- The padding of
.container(--cx-container-padding) is 1rem, and 1.5rem frommd, where it was 0.75rem at every breakpoint. Set$container-paddings, or the$margin-*variables, to keep the old padding - The gap of
.gridand.grid-fill(--cx-grid-gutter) is 1rem, and 1.5rem frommd, where it was 0.5rem, 1rem, 1.5rem, 2rem, 2.5rem and 3rem fromxsto2xl. Set$grid-gutters, or the$gutter-*variables, to keep the old gaps - The column counts stay 12 at every breakpoint
--cx-opacity-fg-subtleis 0.6 where it was 0.5, and--cx-opacity-icon-subtle0.5 where it was 0.4, with everyfg-subtleandicon-subtlecolor, thespinner-opacity-subtleandtext-decoration-opacity-subtleutilities and the idle icon of the switch. Thefg-subtleof theprimary,secondary,neutral,danger,success,warningandinfocontexts has an alpha of 0.7- In the dark theme,
fg-main,fg-highlight,link-main,link-hoverandlink-activeof the same seven contexts are lighter shades of their palette, and so are the colors made from them (fg-subtle,fg-slight,border-subtle,icon-subtle, the valid and invalid icons of the forms)
-
1a54d5d:
grid-rows-{1…6}: the number of explicit rows of a grid as a class, with the declaration of Tailwind's utility of the same name (grid-template-rows: repeat(n, minmax(0, 1fr)))..grid-rows-2sets the rows of one grid, and takes the place of--cx-grid-rows, which this release removes. The classes are generated up to$grid-rowsand have a variant per breakpoint (.md:grid-rows-3) and per container width (.@md:grid-rows-3), asgrid-cols-*has. The grid bundle has them too- Tailwind entry:
grid-rows-{1…6}are Chassis utilities equal to Tailwind's own, so nothing changes for a project that used Tailwind's;tailwind/merge.jshas agrid-row-countsgroup - 4 KB of
chassis.min.css(0.3 KB gzipped), counted in the sizes of the container-query changeset
-
1cbbc47: Breaking: the flexbox grid, deprecated in 0.6.0, is removed.
.gridis the only grid of Chassis.- Classes removed:
.row,.col,.col-auto,.col-{1…12},.offset-{0…11},.row-cols-auto,.row-cols-{1…6},.g-{size},.gx-{size}and.gy-{size}, with their breakpoint variants. Migrate.rowto.grid,.col-4to.col-span-4,.col-12(or a column with no class below a breakpoint) to.col-span-full,.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-*,.colto.grid-fillon the parent or.d-flexwith.flex-fill, and.col-autoto.d-flexon the parent. Outside a row,.col-{n}used as a width becomes.w-{n}/12,.colbecomes.flex-filland.col-autobecomes.w-auto. An item of a.gridwith no span class is one track wide, not full width .gridno longer declares a row. It set one explicit row ofminmax(0, 1fr)(--cx-grid-rows, 1 by default), which took all the free space of a grid with a set height and left the rows after it at their content height, or at nothing when the content was taller than the grid. The rows are now implicit, as tall as their content.--cx-grid-rowsis gone: use.grid-rows-{n}or agrid-template-rowsdeclaration. The internal--cx-columns,--cx-rowsand--cx-gapthat.gridset on itself, and its descendants inherited, are gone too.col-start-13and.row-start-7are removed, with their breakpoint variants: an item that starts on the last line of the grid lies outside it, in an implicit track. The start classes go from1to$grid-columnsand$grid-rows$enable-cssgridis$enable-grid-system, and governs the whole grid system: withfalsethe grid utilities (grid-cols-*,grid-rows-*,grid-flow-*,auto-cols-*,auto-rows-*) and the grid rules of the card are left out too, where the old option removed.gridand its placement classes only. That is 33 KB ofchassis.min.css(3.6 KB gzipped). The containers, the gap utilities, the fraction widths and the:rootgrid variables stay. A@use … with ($enable-cssgrid: …)no longer compilesgrid-auto-flow-*isgrid-flow-*, Tailwind's name and values:.grid-auto-flow-row,.grid-auto-flow-columnand.grid-auto-flow-densebecome.grid-flow-row,.grid-flow-coland.grid-flow-dense, with.grid-flow-row-denseand.grid-flow-col-densebeside them. The entry of$utilitiesis"grid-flow", and the group oftailwind/merge.jswith it.order-firstisorder: -9999and.order-lastorder: 9999, where they were -1 and 6: anorderabove 5, set inline or by an added class, no longer overtakes.order-last. In the Tailwind entry the two are equal to Tailwind's and lose their!important.grid-cols-subgridis a utility, thesubgridvalue of the column counts, in theutilitieslayer with.grid-cols-{n}where it was inlayout, and with their variants (.md:grid-cols-subgrid). In the Tailwind entry it is no longer an excluded class but a Chassis utility equal to Tailwind's- The old names of the placement classes are removed:
.g-col-{n}is.col-span-{n},.g-start-{n}is.col-start-{n}, and.grid-cols-fillis.col-span-full - Sass removed: the mixins
make-row(),make-col-ready(),make-col(),make-col-auto(),make-col-offset(),row-cols()andmake-grid-columns(); the variables$grid-gutter-x,$grid-gutter-y,$grid-row-columns,$guttersand$container-padding-x; the option$enable-grid-classes; the$gutterparameter ofmake-container(). A@use … with (…)that configures one of them no longer compiles. Set$grid-guttersfor the gap of.gridand$container-paddingsfor the padding of.container, both per breakpoint .containerpads with--cx-container-paddingdirectly. It no longer sets--cx-gutter-xand--cx-gutter-y, and a--cx-gutter-xset on a container no longer changes its padding: set--cx-container-paddingto the padding itself, half of the old value--cx-card-group-margin, the space between the stacked cards of a.card-group, defaults to half of--cx-grid-gutter(0.5rem, and 0.75rem frommd) where it was 0.75rem.$toast-spacingkeeps its 1.5rem, now from$space-xlargeCard: the rules of a.card-bodythat holds only an image match the items of a.grid(.grid > [class*="col-span-"]), no longer the columns of a.row- Tailwind entry: the flexbox grid utilities, the
g-col-*andg-start-*aliases and thelayoutsublayer ofutilitiesthat held them are gone, so the entry emits no grid@utilityat all.col-{n}andcol-autoare Tailwind core's own utilities again (col-6isgrid-column: 6): markup that still carries a flexbox grid class compiles without an error and renders something else.scss/tailwind/mixins/_grid.scssis removed, withmake-grid-columns-tailwind(),make-cssgrid-tailwind()andgenerate-tailwind-grid-merge-manifest() tailwind/merge.js: the groupsgrid-col,grid-row-cols,grid-offset,grid-gutter,grid-gutter-xandgrid-gutter-yare gone, and so arecol-start-endandcol-start, which held only the aliases. tailwind-merge resolvescol-span-*andcol-start-*by itself- The grid bundle (
chassis-grid.css) hasflex-filland its breakpoint variants, which its utility list named by a key that did not exist. Its other flex, alignment and spacing utilities stay - The removal takes 20 KB off
chassis.min.css(2.6 KB gzipped) and off the grid bundle. The sizes of the release are in the container-query entry
- Classes removed:
-
c071ddb:
fg-opacity-a11ysets the opacity of a foreground color to--cx-opacity-fg-a11y, the alpha that@chassis-ui/tokens0.7.0 gives thefg-subtlecolor of theprimary,secondary,neutral,danger,success,warningandinfocontexts.:rootdeclares the custom property, from the new$opacity-fg-a11y, a key of$context-opacitiesand of$fg-opacities. Intailwind/merge.jsthe class is in thefg-opacitygroup. -
c071ddb: The subtle text of a context variant has the alpha of its context.
%solid-context,%smooth-contextand%outline-contextcomputed--cx-fg-subtlewith--cx-opacity-fg-subtlein every context, so a.badge.smoothor a.context.outlinein a colored context had fainter subtle text than thefg-subtletoken of that context, whose alpha@chassis-ui/tokens0.7.0 raised.The
context()mixin now sets--cx-context-opacity-fg-subtle, which the variants read:--cx-opacity-fg-a11yin the contexts of the new$a11y-contexts(primary,secondary,neutral,danger,success,warningandinfo), and--cx-opacity-fg-subtlein the others, which render as before. -
3067e9e:
w-100andw-autohave a variant per breakpoint (md:w-100,lg:w-auto), like the fraction widths:w-6/12 lg:w-autoends a fraction at a breakpoint. The two values moved from thewidthentry of$utilitiesto the responsivewidth-fractionentry;w-25,w-50andw-75stay without variants.Breaking: in
tailwind/merge.jsthe width classes are inw, the width group of tailwind-merge, and thewidthandwidth-fractiongroups are gone. A fraction now resolves against the other widths (twMerge('w-6/12', 'w-auto')isw-auto). Nothing changes for a project that passesclassGroupstoextendTailwindMergewhole.
Patch Changes
-
43764e3: The grid bundle (
chassis-grid.css) declares the order of the cascade layers, as the reboot and utilities bundles do. Without the statement its layers were ordered as they appeared, so a bundle loaded after it putrebootabovelayoutandutilities. The statement moved fromscss/_root.scsstoscss/_layer-order.scss, which_root.scssloads.The breakpoint and grid custom properties moved to the end of the
:rootrule, which their media query no longer splits in two.