-
Notifications
You must be signed in to change notification settings - Fork 756
Description
From what I understand, the current behavior of display: contents is similar to box-suppress: hide (except that it only applies to the current element, not its children):
Properties that rely on boxes but do not rely on layout, such as animations, counter-increment, etc., must work as normal on this element and its descendants.
Issue 1 of display: contents raises the question as to whether it should take non-layout-related properties into account as well. I think it might be a good idea to have both a hide and a discard analogue on display as well.
I suggest adding a display: discard keyword, which behaves (more or less) analogous to box-suppress: discard and keep the behavior of display: contents as it as (analogous to hide).
Meaning the element would not generate a box, all other CSS properties on the element and pertaining to the element would be ignored and sibling/descendant selectors wouldn't register it as an element either.
Use-Case
Third-party markup which contains unwanted elements and could destroy the layout.
(Content Management Systems can inject unsightly markup for frontend-editing purposes for example.)