Skip to content
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

Implement and document hide- classes #140

Closed
wants to merge 2 commits into from
Closed

Conversation

azz
Copy link

@azz azz commented Nov 26, 2015

As requested in #138, I've implemented and documented some classes that provide the ability to hide or show content based on viewport size.

The classes are:

  • hide-xs, hide-sm, hide-md, hide-lg: Hide only on the viewports specified.
  • hide-sm-up: Same as hide-sm hide-md hide-lg.
  • hide-md-up: Same as hide-md hide-lg.
  • hide-sm-down: Same as hide-xs hide-sm.
  • hide-md-down: Same as hide-xs hide-sm hide-md.

New documentation visible at: http://derflatulator.github.io/flexboxgrid/#hiding

There is no real need for show- classes, as at most two hide- classes would be required for any configuration.

}
}

@media only screen and (max-width: 75em) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these max-widths should probably be more like 74.9375em otherwise they apply too far up?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. How did you determine that number exactly?

@kristoferjoseph
Copy link
Owner

Flexbox grid will not be adding this feature.

@boustanihani
Copy link

@kristoferjoseph could you please explain why 😥 ? IMO this is very useful...

@kristoferjoseph
Copy link
Owner

screenshot 2016-01-28 11 26 39

@bitdivision
Copy link

Quoting Ethan Marcotte:

'But that said, there're definitely edge cases where it's handy. I just try to avoid using it as a default approach, personally.'

As far as I can tell, most of the work for this has been done, there's seemingly little to lose by adding it to the project (other than a small amount of bloat), and it does handily solve those edge cases mentioned above.

@boustanihani
Copy link

@bitdivision 👍

@alexhawkins
Copy link

+1 on adding

@bitdivision bitdivision mentioned this pull request Mar 4, 2016
@tzapu
Copy link

tzapu commented Jun 8, 2016

+1 on adding ...
if you ve got a column you really don t want on mobiles, maybe some navigation shortcuts, or banners or whatever, it would be quite handy to hide them...

@smooth-operator
Copy link

+1 on adding

@hufeihxw
Copy link

hufeihxw commented Jun 27, 2016

Isn't hiding/showing considered as some kind of "different behavior" too?
Another edging case is server side rendering, server side codes will most likely return the complete dom structure without considering media-query

@nomadtechie
Copy link

+1 on adding this... this is a super helpful feature.

@djensen47
Copy link

One use case for this is advertising. You don't want to try to show a 300x250 add block on a mobile screen. Instead, you want to use the mobile add. Responsive ads are getting better but it is still very nice to avoid showing big ad blocks.

@djensen47
Copy link

Looks like there is this now: https://github.com/lgg/flexboxgrid-helpers

Maybe add a link to the docs?

@kristoferjoseph
Copy link
Owner

I think it will make it into 7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet