This concept of a fluid-grid aims to replace fluid-container and should be used in conjunction with the recently introduced stack-* utilities. Stacks take care of vertical spacing and this new fluid grid handles horizontal spacing on a block level.
The fluid grid is a horizontal block that spans from browser edge to browser edge to give you the ability to create full bleed containers or something in between. For example an image that has to start on the middle of the page but extend to the browser edge. This isn't possible with the current solution.
Together with the stack utilities you can create layouts that look like this:
You can use custom utilities or arbitrary values to place items on the grid. E.g: md:col-start-[col-3] md:col-span-8.
I've tried letting direct children fall on the content area by default, but this immediately introduces specificity issues as this has a higher specificity then span-full:
We could wrap it in a :where pseudo selector to remove the specificity, but I think I prefer the explicitness of us being in control of grid placement and not to have automagic defaults. Not sure though.
The following utilities are present to use for spanning items on the grid. In our case they will be used on Bard sets like: text, image, table, video and pull quote and they can be customised on a per-site basis.
The Custom Property col-gap is added to the Tailwind spacing scale so you can use the gap size of fluid grid. For example when you want to nest grids but don't want to rely on the subgrid spec yet:
<section class="fluid-grid">
<div class="span-content grid grid-cols-12 gap-fluid-grid-gap">
// Children will fall on a new 12 column that perfectly aligns with the parent fluid grid.
</div>
</section
With subgrid you could use:
<section class="fluid-grid">
<div class="span-content grid grid-cols-subgrid">
// Children will fall on a new 12 column that perfectly aligns with the parent fluid grid.
</div>
</section
You can use the fluid-grid-gap everywhere. For example with stacks should you want to: stack-fluid-grid-gap or margins: mb-fluid-grid-gap.
The full width grid concept is inspired by @marcorieser.
This concept of a
fluid-grid
aims to replacefluid-container
and should be used in conjunction with the recently introducedstack-*
utilities. Stacks take care of vertical spacing and this new fluid grid handles horizontal spacing on a block level.The fluid grid is a horizontal block that spans from browser edge to browser edge to give you the ability to create full bleed containers or something in between. For example an image that has to start on the middle of the page but extend to the browser edge. This isn't possible with the current solution.
The CSS used looks like this:
This is the grid it creates:
Together with the stack utilities you can create layouts that look like this:
You can use custom utilities or arbitrary values to place items on the grid. E.g:
md:col-start-[col-3] md:col-span-8
.I've tried letting direct children fall on the
content
area by default, but this immediately introduces specificity issues as this has a higher specificity thenspan-full
:We could wrap it in a :where pseudo selector to remove the specificity, but I think I prefer the explicitness of us being in control of grid placement and not to have automagic defaults. Not sure though.
The following utilities are present to use for spanning items on the grid. In our case they will be used on Bard sets like: text, image, table, video and pull quote and they can be customised on a per-site basis.
The Custom Property
col-gap
is added to the Tailwind spacing scale so you can use the gap size of fluid grid. For example when you want to nest grids but don't want to rely on the subgrid spec yet:With subgrid you could use:
You can use the
fluid-grid-gap
everywhere. For example with stacks should you want to:stack-fluid-grid-gap
or margins:mb-fluid-grid-gap
.The full width grid concept is inspired by @marcorieser.