Grid Template Shorthand #14024
Technobabble17
started this conversation in
Ideas
Replies: 1 comment
-
This is actually a brilliant idea. A shorthand would be so useful for projects that constantly utilize grids. I also don't see any wild conflicts with the current system. Really hoping for consideration on this idea! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I work a lot with the 12 column grid layout, and it's apparent that tailwind finds the 12fr layout vital as there are classes for both columns and rows. I also find it cumbersome to manage col-start/end and span states when dealing with breakpoints and logic states. (Also I'm sure I can make this into my own plugin, just thought it would be a nice addition to core)
What if there was shorthand support for col-start/end row-start/end:
ex.)
cols-1-7
(col-start-1, col-end-7)
**cols-4
(col-start-4)**
rows-7-11
(row-start-7, row-end-11)
cols-full
(grid-column: 1 / -1) to avoid switching between col-span and this shorthand syntax
Shorthand version:
(I'm cheating with !important to avoid an else statement, but) I find this easier to read.
Other notes:
I would imagine "grid-cols-2-4" might fit the naming scheme better, but:
this syntax would *probably work with any grid system (grid grid-cols-8)
it could be made extensible from gridTemplateColumns (grid-cols-16 -> cols-9-17)
spans are powerful for repeating layouts, but difficult when trying to position specifically around state
Beta Was this translation helpful? Give feedback.
All reactions