Replies: 2 comments
-
PR #2307 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've released a package on npm which provides the plugin: |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Having named grid lines would be useful for some grid layouts, especially responsive designs, and when adding lines to an existing grid.
For example, starting with these two layouts:
If we want to insert a new line down the centre of the page - we'll have to update
col-end
andcol-start
classes on existing content:Also, layouts like
0 1rem 1fr 1rem 0
add unnecessary zero-width columns just so that we don't have to add responsivecol-end
andcol-start
classes.With named lines, we could do something like this:
In the HTML we can have classes like
col-start-gutter-left
orcol-end-content-right
, providing more flexibility to introduce new lines or move the lines for responsive layouts. Obviously, we'll need to do something likecol-start-center md:col-start-content-right
in some places, but this would be less burdensome thancol-start-4 md:col-start-3
- and more readable, too.An additional consideration for grid is that line names do not have to be unique:
In this case the lines are numerically indexed (
offset-1
, etc). The class would look likecol-start-offset-1
orcol-end-offset-2
.In terms of generating the utilities -
grid-template-columns
andgrid-template-rows
would be simply copies of the strings just as they are now. Creating the named line utilities would need the string to be parsed for names, and indexes added to repeated names.Beta Was this translation helpful? Give feedback.
All reactions