Grid layout system: column and row templates, auto-fit and auto-fill tracks, flow, alignment and item placement.
Gap utilities are defined in _spacing.scss.
Generated from the doc blocks in the core source when the site is built, so it always matches the current release of @wovenui/core. Every example is compiled against core during the build; open Compiled CSS under an example to see its output. Guide: Grid . The A to Z index lists every public mixin and function.
Mixins cols rows cols-custom auto-fit auto-fill flow-row flow-col flow-dense justify align place col-span row-span col-start col-end row-start row-end grid-place-at grid-col-at grid-row-at
cols mixin Sets grid-template-columns to a number of equal columns that can shrink below their content width.
Parameter Type Default Description $countNumber|StringRequired Number of columns: a whole number of 1 or more, calc() or var(); anything else raises an error
Output grid-template-columns: repeat($count, minmax(0, 1fr))Example
@include apply ( grid , cols ( 3 ), gap ( 4 ) ) ;
Compiled CSS grid-template-columns : repeat ( 3 , minmax ( 0 , 1 fr ));
--wu-gap : var ( --wu-space-4 );
grid-template-columns on MDN
See also: rows , cols-custom , auto-fit . Source: layouts/_grid.scss:46
rows mixin Sets grid-template-rows to a number of equal rows that can shrink below their content height.
Parameter Type Default Description $countNumber|StringRequired Number of rows: a whole number of 1 or more, calc() or var(); anything else raises an error
Output grid-template-rows: repeat($count, minmax(0, 1fr))Example
Compiled CSS grid-template-rows : repeat ( 2 , minmax ( 0 , 1 fr ));
grid-template-rows on MDN
See also: cols . Source: layouts/_grid.scss:60
cols-custom mixin Sets grid-template-columns to a custom track list, with underscores standing in for spaces.
@mixin cols-custom ( $template )
Parameter Type Default Description $templateString|ListRequired Track list, quoted ("1fr_auto_1fr", each underscore outside brackets and parentheses becomes a space) or unquoted (1fr auto 1fr)
Example
@include cols-custom ( " 250px_1fr " ) ; // grid-template-columns: 250px 1fr
Compiled CSS grid-template-columns : 250 px 1 fr ;
grid-template-columns on MDN
See also: cols . Source: layouts/_grid.scss:73
auto-fit mixin Creates as many columns of at least $min-width as fit, collapsing empty tracks so items stretch to fill the row.
@mixin auto-fit ( $min-width )
Parameter Type Default Description $min-widthLength|StringRequired Minimum column width: a $grid-item-sizes key (xs, sm, md, lg, xl; sm gives 250px by default), a length or percentage, calc() or var(), or a whole minmax() track used as written; a unitless number or unknown word raises an error
Output grid-template-columns: repeat(auto-fit, minmax($min-width, 1fr))Example
@include apply ( grid , auto-fit ( 250 px ), gap ( 4 ) ) ;
Compiled CSS grid-template-columns : repeat ( auto-fit , minmax ( 250 px , 1 fr ));
--wu-gap : var ( --wu-space-4 );
grid-template-columns on MDN
See also: auto-fill . Source: layouts/_grid.scss:131
auto-fill mixin Creates as many columns of at least $min-width as fit, keeping empty tracks so items keep their column width.
@mixin auto-fill ( $min-width )
Parameter Type Default Description $min-widthLength|StringRequired Minimum column width: a $grid-item-sizes key (xs, sm, md, lg, xl; sm gives 250px by default), a length or percentage, calc() or var(), or a whole minmax() track used as written; a unitless number or unknown word raises an error
Output grid-template-columns: repeat(auto-fill, minmax($min-width, 1fr))Example
@include auto-fill ( 200 px ) ;
Compiled CSS grid-template-columns : repeat ( auto-fill , minmax ( 200 px , 1 fr ));
grid-template-columns on MDN
See also: auto-fit . Source: layouts/_grid.scss:154
flow-row mixin Sets grid-auto-flow to row, placing items row by row; same as the .flow-row class.
grid-auto-flow on MDN
See also: flow-col , flow-dense . Source: layouts/_grid.scss:169
flow-col mixin Sets grid-auto-flow to column, placing items column by column; same as the .flow-col class.
Example
Compiled CSS grid-template-rows : repeat ( 3 , minmax ( 0 , 1 fr ));
grid-auto-flow on MDN
See also: flow-row . Source: layouts/_grid.scss:182
flow-dense mixin Sets grid-auto-flow to dense so later items back-fill earlier gaps; same as the .flow-dense class.
grid-auto-flow on MDN
See also: flow-row . Source: layouts/_grid.scss:194
justify mixin Sets justify-items, aligning grid items along the inline axis of their cells.
Grid only: for flex containers use the flex justify mixins (start, center, between).
Parameter Type Default Description $valueStringRequired Any justify-items value, such as start, end, center or stretch
Example
@include apply ( grid , cols ( 3 ), justify ( center ) ) ;
Compiled CSS grid-template-columns : repeat ( 3 , minmax ( 0 , 1 fr ));
justify-items on MDN
See also: align , place . Source: layouts/_grid.scss:219
align mixin Sets align-items, aligning grid items along the block axis of their cells.
Grid only: for flex containers use the x-* mixins (x-center, x-start).
Parameter Type Default Description $valueStringRequired Any align-items value, such as start, end, center or stretch
align-items on MDN
See also: justify , place . Source: layouts/_grid.scss:235
place mixin Sets place-items, aligning grid items on both axes of their cells at once.
Grid only.
Parameter Type Default Description $valueStringRequired Any place-items value, such as center or start end
place-items on MDN
See also: justify , align . Source: layouts/_grid.scss:251
col-span mixin Makes a grid item span a number of columns.
Parameter Type Default Description $spanNumber|StringRequired Number of columns to span: a whole number of 1 or more, calc() or var(); anything else raises an error
Output grid-column: span $span / span $spanExample
Compiled CSS grid-column : span 2 /span 2 ;
grid-column on MDN
See also: row-span , col-start . Source: layouts/_grid.scss:267
row-span mixin Makes a grid item span a number of rows.
Parameter Type Default Description $spanNumber|StringRequired Number of rows to span: a whole number of 1 or more, calc() or var(); anything else raises an error
Output grid-row: span $span / span $spangrid-row on MDN
See also: col-span . Source: layouts/_grid.scss:282
col-start mixin Sets grid-column-start, the column line where the item begins.
Parameter Type Default Description $startNumber|StringRequired Line number, line name or span value
grid-column-start on MDN
See also: col-end . Source: layouts/_grid.scss:296
col-end mixin Sets grid-column-end, the column line where the item ends.
Parameter Type Default Description $endNumber|StringRequired Line number, line name or span value
Example
@include col-end ( -1 ) ; // runs to the last column line
Compiled CSS grid-column-end on MDN
See also: col-start . Source: layouts/_grid.scss:308
row-start mixin Sets grid-row-start, the row line where the item begins.
Parameter Type Default Description $startNumber|StringRequired Line number, line name or span value
grid-row-start on MDN
See also: row-end . Source: layouts/_grid.scss:320
row-end mixin Sets grid-row-end, the row line where the item ends.
Parameter Type Default Description $endNumber|StringRequired Line number, line name or span value
grid-row-end on MDN
See also: row-start . Source: layouts/_grid.scss:332
grid-place-at mixin Sets grid-column and grid-row together to place an item in the grid.
For start / end pairs pass list.slash(1, 3); a literal 1 / 3 is Sass division and warns.
@mixin grid-place-at ( $col , $row )
Parameter Type Default Description $colNumber|String|ListRequired Value for grid-column, such as 2 or span 2 $rowNumber|String|ListRequired Value for grid-row, such as 1 or span 2
Example
@include grid-place-at ( 2 , span 2 ) ;
Compiled CSS See also: grid-col-at , grid-row-at . Source: layouts/_grid.scss:347
grid-col-at mixin Sets grid-column to place an item across columns.
Parameter Type Default Description $colNumber|String|ListRequired Value for grid-column, such as 2, span 2 or list.slash(1, -1)
Example
@include grid-col-at ( list . slash ( 1 , -1 ) ) ; // grid-column: 1 / -1
Compiled CSS grid-column on MDN
See also: grid-place-at . Source: layouts/_grid.scss:371
grid-row-at mixin Sets grid-row to place an item across rows.
Parameter Type Default Description $rowNumber|String|ListRequired Value for grid-row, such as 2, span 2 or list.slash(1, 3)
Example
@include grid-row-at ( span 2 ) ;
Compiled CSS grid-row on MDN
See also: grid-place-at . Source: layouts/_grid.scss:383