Grid Fr Auto
GridFrAuto
creates a two column grid. The first column is 1fr
and the second column is auto
. It also takes care of minmax
declarations for you.
-->
GridFrAuto
creates a two column grid. The first column is 1fr
and the second column is auto
. It also takes care of minmax
declarations for you.
GridFrAuto
creates a two column grid with fr
and auto
.
Add a width
to the auto
grid item to create a fixed-width sidebar.
By itself, GridFrAuto
is not responsive-friendly, but you can combine it with SingleCol
on smaller breakpoints to make great responsive layouts.
GridFrAuto
lets you create a two-column grid with 1fr
as the first column and auto
as the second column.
You can add a width
for the auto
layout if you need it to be a specific size.
You can change the gap between grid items with the gap
property or the --gap
variable.
GridFrAuto
is not responsive is nature so you should use it only at certain breakpoints.
One common way is to use SingleCol
at mobile breakpoints and GridFrAuto
at desktop breakpoints.
If you give your auto
grid item a width
property, that auto
grid item will not be full width on mobile. This is correct because your width
value is being used.
But you normally don’t want items to happen in most layouts. There are two ways to fix this.
width
items-center
By doing this, you ensure width
remains unchanged (from the auto
value) on mobile. So it will respect the default align-items: stretch
from SingleCol
.
By using items-center
you change SingleCol
s default align-items: stretch
to align-items: center
. This centers the offending element.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
GridFrAuto
lets you create a two-column grid with 1fr
as the first column and auto
as the second column.
You can add a width
for the auto
layout if you need it to be a specific size.
You can change the gap between grid items with the gap
property or the --gap
variable.
GridFrAuto
is not responsive is nature so you should use it only at certain breakpoints.
One common way is to use SingleCol
at mobile breakpoints and GridFrAuto
at desktop breakpoints.
If you give your auto
grid item a width
property, that auto
grid item will not be full width on mobile. This is correct because your width
value is being used.
But you normally don’t want items to happen in most layouts. There are two ways to fix this.
width
items-center
By doing this, you ensure width
remains unchanged (from the auto
value) on mobile. So it will respect the default align-items: stretch
from SingleCol
.
By using items-center
you change SingleCol
s default align-items: stretch
to align-items: center
. This centers the offending element.
Here’s the CSS for GridFrAuto
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Here’s the CSS for GridFrAuto
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
CSS Variable | Default | Description |
---|---|---|
--gap | 1rem | Gap between columns |
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
CSS Variable | Default | Description |
---|---|---|
--gap | 1rem | Gap between columns |