Grid Auto Fr
GridAutoFr
is the opposite of GridFrAuto
. It puts the auto
column before the fr
column.
-->
GridAutoFr
is the opposite of GridFrAuto
. It puts the auto
column before the fr
column.
GridAutoFr
creates a two column grid with auto
and fr
.
Add a width
to the auto
grid item to create a fixed-width sidebar.
By itself, GridAutoFr
is not responsive-friendly, but you can combine it with SingleCol
on smaller breakpoints to make great responsive layouts.
GridAutoFr
lets you create a two-column grid with auto
as the first column and 1fr
as the second column.
It is not widely used for macro layouts because Shell-grid
does a better job, but it can be used to create micro layouts in place of flex
and flex-grow
.
You can add a width
to the grid item to control the size of the auto
column if you wish to.
You can change the gap between grid items with the gap
property or the --gap
variable.
The responsive behaviour for GridAutoFr
is the same as that for GridFrAuto
. It 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 GridAutoFr
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.
GridAutoFr
lets you create a two-column grid with auto
as the first column and 1fr
as the second column.
It is not widely used for macro layouts because Shell-grid
does a better job, but it can be used to create micro layouts in place of flex
and flex-grow
.
You can add a width
to the grid item to control the size of the auto
column if you wish to.
You can change the gap between grid items with the gap
property or the --gap
variable.
The responsive behaviour for GridAutoFr
is the same as that for GridFrAuto
. It 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 GridAutoFr
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 GridAutoFr
.
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 GridAutoFr
.
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 |