Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

The styles for hide/show[-xx[-yy]] are wrong #772

Closed
@gkalpak

Description

@gkalpak

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:

  1. show is unnecessary (since elements are shown (i.e. not hidden)) without needing any attribute (and overriding hide across all devices doesn't make sense).
  2. show[-xx[-yy]] should only negate hide (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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions