Skip to content
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

Sorting the CSS-Cascade-6 keys #1779

Merged
merged 12 commits into from
Sep 25, 2024
Merged

Conversation

mirisuzanne
Copy link
Contributor

@mirisuzanne mirisuzanne commented Sep 13, 2024

While revert-layer is a new global value for explicit defaulting (like initial, etc) - it's generally considered part of the Cascade Layers feature.

Those other keys here are a problem. 😅 There are several names we would use for them in spec circles…

  • What they are: the 'global keywords' or 'global values'
  • What they do: 'explicit defaulting'

There are a number of resources that list them without any name, or only refer to them individually (including CanIUse), and a couple that refer to them as part of 'inheritance' (which is pretty vague). MDN has them separate but cross-referenced, and then also listed as values for the all property. CanIUse also shows the BCD keys individually, but each named global keywords: (keyword).

Since they are the only values allowed on all CSS properties, they are also the only values allowed on all. The all property is useless without these values - but they are very useful without all.

(side note: several of the top articles describe the feature wrong)

I find 'explicit defaulting' to be the most useful term here, for both the values and the all shorthand. But it also feels the most technical, and I can't argue that it's a popular term (I guess I have a new mission). I think the most accurate reflection of developer language is likely to list them as separate features.

We could consider adding them to a group (named what?) for better cross-reference.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Sep 13, 2024
Copy link
Collaborator

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the feature composition makes sense. I made a few suggestions for description length, and also to favor the The <property> <sets> the <noun> format that moves the most important parts to the front.

features/initial-value.yml Outdated Show resolved Hide resolved
features/revert-value.yml Outdated Show resolved Hide resolved
features/all.yml Outdated Show resolved Hide resolved
Co-authored-by: James Stuckey Weber <[email protected]>
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. I have some suggestions for consistency in descriptions or to satisfy the test scripts. The only other thought I have here is that "explicit defaulting" is a really helpful lens. I don't think we can get away with defining a feature with that name (or at least not yet), but I think a group for explicit defaulting makes a ton of sense, if you'd like to put all of these in such a group.

features/all.yml Outdated Show resolved Hide resolved
features/cascade-layers.yml Outdated Show resolved Hide resolved
features/inherit-value.yml Outdated Show resolved Hide resolved
features/initial-value.yml Outdated Show resolved Hide resolved
features/revert-value.yml Outdated Show resolved Hide resolved
features/unset-value.yml Outdated Show resolved Hide resolved
@mirisuzanne
Copy link
Contributor Author

@jamesnw @ddbeck thanks for the feedback! I think I've incorporated your notes, and added the explicit-defaults group, but check my work.

Ideally, revert-layer is both part of the Cascade Layers feature, and also the explicit-defaults group. But I don't think that's possible, unless we put all of Cascade Layers into that group? We could call it 'explicit cascading' instead…

@jamesnw
Copy link
Collaborator

jamesnw commented Sep 24, 2024

Ideally, revert-layer is both part of the Cascade Layers feature, and also the explicit-defaults group. But I don't think that's possible, unless we put all of Cascade Layers into that group? We could call it 'explicit cascading' instead…

Features can't be part of another feature, but we could add a Cascade Layers group, and then explicit defaults could either be a child of that larger group, or revert-value could be in both groups.

@ddbeck
Copy link
Collaborator

ddbeck commented Sep 24, 2024

@jamesnw's suggestion is the only way we could handle that now. We need to resolve #1173 to be able to put the key in multiple features (or at a higher level, have composite features that can be made up smaller atoms, see #971).

I think this looks good for now, but it would be nice to leave a comment on the cascade layers file, mentioning the possibility of doing that later?

@mirisuzanne
Copy link
Contributor Author

@ddbeck looks like it needs to be re-approved with that change.

@ddbeck
Copy link
Collaborator

ddbeck commented Sep 25, 2024

We're so close now. Prettier needs to be run on this and then we can merge.

@jamesnw
Copy link
Collaborator

jamesnw commented Sep 25, 2024

We're so close now. Prettier needs to be run on this and then we can merge.

@ddbeck Done!

@ddbeck ddbeck merged commit 8096da8 into web-platform-dx:main Sep 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants