-
Notifications
You must be signed in to change notification settings - Fork 715
[css-contain-3] CSS-wide keywords in style() #7080
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
Comments
In other words, the global keywords should be replaced with a value before being compared? |
I mean that |
Actually, that might not be enough, since you can also do |
@andruud My sense is that all of these examples would already return a consistent Am I right that you're basically just asking to make that existing behavior explicit, so we can consider this a parse error instead of attempting the query? |
That's a good point for the CSS-wide keywords. They primarily only do something if they're the 'cascaded value', which they won't be here. (Looks like there's no exception for The same can not be said for e.g. I think it's a good idea to make the existing behavior explicit, as it was not obvious to me for from the spec language. In particular the part which says that values are "computed with respect to the container". Perhaps we can somehow specify that for
Nothing in there allows for |
Oh, if it's possible we can be resolving keywords/variables in both places using the container as a reference, this maybe needs more consideration. I wonder if @fantasai has thoughts on this. |
+1 to disallowing the css-wide keywords, at least the ones requiring cascading |
Given that we resolve Agree that disallowing the CSS-wide keywords syntactically is fine, with them specified to resolve to false if they show up anyway (such as via a variable). fantasai and I think the reasonable options here are:
|
Should we invent a new classification for |
Yeah, that sort of categorization probably makes sense for us to lean on elsewhere, like when we split "tree-abiding pseudo-elements" apart from the rest. |
I'll start working on those spec changes (in both cascade and contain). Agenda+ to get a resolution for defining "cascade-dependent keywords" ( (I imagine that first part might be editorial, as it doesn't change any behavior on its own? Not sure which level of cascade I should target for that, 5 or 6…) |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> subtopic: CSS-wide keywords in style()<fantasai> github: https://github.com//issues/7080 <fantasai> miriam: when we're doing style queries, question is how are CSS-wide keywords handled as values in the query <fantasai> miriam: Comparing that to computed value of the property <fantasai> miriam: Conversation is landing on, there are 2 different types of CSS-wide keywords and maybe want to handle differently <fantasai> miriam: cascade-dependent keywords like revert and revert-layer, should be disallowed entirely <fantasai> miriam: but initial and inherit could be supported <fantasai> miriam: so wanted to distinguish these types in Cascade spec <fantasai> miriam: and say in Container Queries spec that one is supported and other not <Rossen_> q? <fantasai> miriam: that's the proposal here <fantasai> TabAtkins: I'm in favor <fantasai> fantasai: me too <fantasai> TabAtkins: On the implementer side, Anders seems fine with this as well <fantasai> PROPOSAL: Make cascade-dependent keywords revert/revert-layer disallowed in style() queries <fantasai> RESOLVED: Make cascade-dependent keywords revert/revert-layer disallowed in style() queries <fantasai> PROPOSAL: other css-wide keywords (initial, inherit, reset) are allowed <fantasai> RESOLVED: other css-wide keywords (initial, inherit, reset) are allowed |
The term "cascade-dependent keyword" is now defined for you to use, @mirisuzanne |
That must be |
Correct. ^_^ |
Drafted in bb594b7 |
The spec currently says that queried values must be computed in the context of the container, so I assume things like
style(left: 1em)
andstyle(left: var(--x))
should work. But the spec does not say anything about CSS-wide keywords, and I think they should be explicitly disallowed.In particular, satisfying
revert
andrevert-layer
would require cascading-information that is long gone by the time we reach the descendant affected by the query.The text was updated successfully, but these errors were encountered: