2. sds-custom-grid()
A SCSS mixin that provides flexible column control of a CSS Grid container.
Last updated
A SCSS mixin that provides flexible column control of a CSS Grid container.
Last updated
There may be times where a layout requires more asymmetrical regions or columns, and the basic grid with evenly sized/distributed elements will not suffice. To accommodate this, Sipster provides the sds-custom-grid()
mixin.
This works similar to the basic sds-grid()
mixin, but rather than the $columns
parameter representing the number of desired columns, each desired column and width needs to be manually specified. The following example illustrates this.
The common measurement units like px, rem, percentage, etc can be used to control each column's width, but you can also use Fractional Units(fr). These fr units essentially turn a column into a flex column by specifying the size of a track as a fraction of the available space in the grid container.
Just like with the basic sds-grid()
mixin, this sds-custom-grid()
mixin also accepts an optional $gap
parameter that controls the space between columns:
which compiles to: