[css-display] box-suppres use cases

Hi All,


I was working once in an issue that could fit well as a use case:



In a form input when is validated a ! (admiration mark) appears beside to
the input indicating an error state. This rule is applied not only in one
form, tons of forms…. Problem is when a lot of people is touching the code
and the display mode is mixed for the same purpose like inline,
inline-block, inline-table, block. Might be was an error since the design
but the problem came fixed overwriting the hide and show methods from
jQuery, so hitting the performance because now for all hide and show
events, need to filter the class and assign the correct display mode. I
guess this rule box-suppress would save the world in those occasions, at
least.



So instead of something like:



function *hide*(e){

                e.style.oldDisplayMode = e.style.display;

                e.style.display = "none";

}



function *show*(e){

                if (e.style.oldDisplayMode)

                                e.style.hide = e.style.oldDisplayMode;

                else

                                // how to know that was block or other
display mode?

                                e.style.display = "block";

}





Would be simpler :



function *hide*(e){

                e.style.boxSuppress = ”hide”;

}



function *show*(e){

                e.style.boxSupress = ”show”;

}



As the spec handles the initial purpose of display:none was to toggle
between the invisible and visible world. So would be great to have a
property like this to avoid touching any other property from the element
that I want to hide/show.



Could be named as well as :



ninja-box

immerse-box




Also I consider there’s no problem with the visibility property as the
purpose is just to hide the colors but not the shape. I have not understand
well the discard vs hide difference. But I guess is not a good idea to do
something similar than *visibility* using *box-suppress*







*Best,*

*Mario Ruiz *

front-end developer

Received on Saturday, 24 September 2016 00:33:45 UTC