-
Notifications
You must be signed in to change notification settings - Fork 677
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
[css-display] Add a new property to replace display: none
declaration
#4897
Comments
This was called
But was deferred to level 4, Changes Prior to CR Status:
|
Thanks a lot @Loirooriol! Here is a short resume of the situation, so this issue should not start the same discussions again:
|
Yup, this is a topic with a long history, that we'll get to in time. Since this thread has pinged the others now, I'll consider its purpose fulfilled; we can see this as another call for prioritization when we next review those threads. I'll go ahead and close this as a dupe, then. Thanks! |
I want to discuss about the
display
property, and more specifically about thenone
value.The associated specification is here: https://drafts.csswg.org/css-display-3/#box-generation
Usecase
I sometimes find
display: none
behavior very frustrating. I want to use it to prevent the rendering, but as a "side-effect" it also changes the display type of the element.For example:
Workaround
When discussing it on twitter with other CSS developers, they said they currently change their CSS architecture because of this problem.
For example, you can avoid this problem by using the
:not()
selector:There are at least two downside of this kind of solution:
Suggestion
What would be great is a new property. It would avoid developers to change their CSS structure because of the current
display: none
behavior. I'm not really good at naming 😄, but since I'm here I will play the game:An example inspired from the previous examples:
If we compare with the current available solutions, I find the code with the new property
render
reflects much better the developer intentions. It also allows us to keep a low selector specificity.There are probably others solutions to find. I just suggested one to start the discussion!
The text was updated successfully, but these errors were encountered: