-
Notifications
You must be signed in to change notification settings - Fork 672
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
"Applies to: all elements" should mean the property applies to ::before and ::after #1861
Comments
The current approach is so confusing. The text says "all elements", the tooltip says "Includes ::before and ::after pseudo-elements", and the link points to https://drafts.csswg.org/css-pseudo/#generated-content. The tooltip info should appear as text, and only the part that mentions pseudo-elements should link to https://drafts.csswg.org/css-pseudo/#generated-content. |
@tabatkins Mind noting what edits you had in mind? |
An explicit anchor to point to that talks about how tree-abiding pseudos are counted as "all elements" along with all the real elements (rather than just pointing to the general section on generated content). |
@tabatkins Well, it's not all 'tree-abiding' pseudo-elements, only :before/:after... But maybe a section explaining specializations of applies-to for pseudo-elements, sure. |
Added a dfn for “applies to” to css-cascade, and added a note about what “all elements” means wrt pseudo-elements. This gives us an anchor to point at. @tabatkins Thinking about also adding
to css-cascade, but debating a bit whether to add it in parentheses or not, and whether to add it before or after the flex example. Thoughts? |
…ter the same way they would to a normal element. #1861
The precise effect of "applying" or "not applying" tends to vary a fair bit. The statement you wrote is generic enough that it's probably fine in all cases, but I wouldn't add it, as I am not sure it helps more than it hurts when it comes to gray zones and other ambiguities. For instance, css-text has a bunch of things that apply to inline boxes. If you try and apply them to block boxes, it inherits into the (possibly anonymous) inline boxes, and has an effect that way. This is not in contradiction with the statement you made, since indeed, there is no effect on the block box, and its only through inheritance that anything happens, but the statement does not shed any light on this situation. Another one would be |
@frivoal Wrt the first point, this is the Cascading and Inheritance module, we should be able to assume you understand the difference between applying to a box and inheriting to descendants. Wrt the second point, the font properties have similar issues. They only apply to text, except insofar as the affect the font-relative units. I think that's a separate issue we can file, about how we want to handle such things. |
I thought there was text somewhere that says that "Applies to: all elements" means that it applies to elements and to the ::before and ::after pseudo-elements (or similar for "Applies to: block-level elements", "Applies to: elements that establish block formatting contexts", etc.).
However, I can't find any such text.
It's possible that the text belongs in css-pseudo, although I tend to think it might belong where we define the "Applies to" line (see also speced/bikeshed#617), or in both places.
The text was updated successfully, but these errors were encountered: