4 ms·
> I think display:none is a regularly annoying design mistake. It would be better to separate the concepts of how the content should be displayed, and whether i
by steveax 10y ago
> I think display:none is a regularly annoying design mistake. It would be better to separate the concepts of how the content should be displayed, and whether it should be displayed in the first place.
This is exactly what the proposed box-suppress property [1] does:
"The display: none value was historically used as a "toggle" to switch between showing and hiding an element. Making this reversible requires either setting up the CSS cascade carefully, or remembering what the display value was before it was set to none. To make this common use-case easier, this module introduces the separate box-suppress property to do the same thing, so that toggling whether or not an element appears in the formatting tree can now be done without affecting its display type when it is displayed."
[1]: https://drafts.csswg.org/css-display/#propdef-box-suppress https://drafts.csswg.org/css-display/#propdef-box-suppress