-
Notifications
You must be signed in to change notification settings - Fork 715
[css-display][css-cascade] Should display: contents
affect inheritance?
#1098
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
The spec also has the following statements:
and
As the CSS Cascade spec states,
the CSS inheritance concept is also based on the document tree, not the box tree, and shouldn't be affected by any display changes. I believe that inheriting properties from the "virtual" container that is not directly affected by them may make much sense. For example, inheriting table-specific properties like |
But note inheritance is not always a document tree concept. From CSS display,
And some pseudo-elements like Anyways, you are right there might also be some advantage in inheriting from non-rendered containers, and with at least two implementations and a near-CR spec, maybe it's not worth to change. |
No, inheritance is definitely not affected by (Otherwise, how would |
This isn't necessarily true... e.g. If you think that is wrong... probably an issue should be filed to that spec. |
display: contents
replaces an element by its children, so I wonder if the children should still inherit from that element.I think it would make more sense if they didn't (except maybe for the
display
property itself?). But on Firefox and Chrome, the inheritance is not affected.Example (https://jsfiddle.net/xyeL8ewr/):
"Foo" is red and "Bar" is blue. But with
display: contents
, it's like if the markup wasso maybe both should be blue.
The text was updated successfully, but these errors were encountered: