Skip to content

[css-grid] Clarify "set" and "reset" in shorthand definitions #7720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdoublev opened this issue Sep 11, 2022 · 2 comments
Closed

[css-grid] Clarify "set" and "reset" in shorthand definitions #7720

cdoublev opened this issue Sep 11, 2022 · 2 comments

Comments

@cdoublev
Copy link
Collaborator

The grid and grid-template properties are shorthands that can be used to set all three explicit grid properties (grid-template-rows, grid-template-columns, and grid-template-areas) at the same time. The grid shorthand also resets properties controlling the implicit grid, whereas the grid-template property leaves them unchanged.

https://drafts.csswg.org/css-grid-2/#explicit-grids

Because there is at the same time, I assume that set all three explicit grid properties means that setting the shorthand will result to a declaration for each sub-property, possibly to its initial value, and whether or not an explicit value is specified in the shorthand input value for each sub-property.

Then I would like to suggest replacing resets by sets because grid also allows to set grid-auto-* from a value explicitly specified in the input value.

@cdoublev cdoublev changed the title [css-grid-1] Clarify "set" and "reset" in shorthand definitions [css-grid] Clarify "set" and "reset" in shorthand definitions Sep 11, 2022
@Loirooriol Loirooriol added css-grid-1 css-grid-2 Subgrid; Current Work labels Sep 11, 2022
@tabatkins
Copy link
Member

In the context of this paragraph, we're explicitly calling out the difference between setting the explicit grid properties with the 'grid-template' shorthand vs the 'grid' shorthand; when used for this purpose, the 'grid' shorthand does indeed “reset” the grid-auto properties. While 'grid' can also “set” the grid-auto properties if used in a different way, that's not relevant to what's being said here, so I'd prefer to leave the text as it is.

Let us know if you if you find this explanation acceptable?

@cdoublev
Copy link
Collaborator Author

cdoublev commented Oct 4, 2022

Yes, in [Defining an] Explicit grid , there is actually no need to mention the ability of grid to define an implicit grid. A CSS author can learn this later, and even figure it out on its own since it seems obvious that if grid resets these properties, it can also set them.

@cdoublev cdoublev closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants