Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.