The styles for hide/show[-xx[-yy]]
are wrong #772
Description
I think that the current implementation of hide[-xx[-yy]]
/show[-xx[-yy]]
is kind of broken and confusing (not sure if it is so by design or as a result of a bug in style declarations).
Based on the current styles it seems that show-xx-yy
can negate hide-xx-yy
, which seems to have little point (why would I want to define show-xx-yy
and hide-xx-yy
on the same element). Furthermore it comes to contradiction with the docs, which state that show[-xx[-yy]]
"negates hide" (not hide[-xx[-yy]]
).
It is makes much more sense (imo) anyway:
Either show the element "by default" and use appropriate hide-xx[-yy]
attributes to hide it on specific devices or hide the element "by default" (using hide
) and use appropriate show-xx[-yy]
attributes to negate hide
and make the element visible on specific devices.
Mixing both approaches won't help.
That said, I believe that:
show
is unnecessary (since elements are shown (i.e. not hidden)) without needing any attribute (and overridinghide
across all devices doesn't make sense).show[-xx[-yy]]
should only negatehide
(on appropriate screen-sizes).
According to the above, here are the selectors that should have a display: none;
style per screen-size:
any: 0 < size
sm: 0 < size < 600
- [hide-sm]
gt-sm: 600 < size
- [hide-gt-sm]
md: 600 < size < 960
- [hide-md]
gt-md: 960 < size
- [hide-gt-md]
lg: 960 < size < 1200
- [hide-lg]
gt-lg: 1200 < size
- [hide-gt-lg]
BTW, this is related to the problem described in #764.
I hope all this makes sense, because I used make sense
too many times...