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

Feature Request: Hide/Show breakpoints #13

Closed
boustanihani opened this issue Jan 27, 2016 · 13 comments
Closed

Feature Request: Hide/Show breakpoints #13

boustanihani opened this issue Jan 27, 2016 · 13 comments

Comments

@boustanihani
Copy link

Could you please add a way to show or hide content depending on the screen size (breakpoints)?

Something similar to: http://getbootstrap.com/css/#responsive-utilities-classes

  • visible-xs
  • visible-sm
  • visible-md
  • visible-lg
  • hidden-xs
  • hidden-sm
  • hidden-md
  • hidden-lg
@0zguner
Copy link

0zguner commented Jan 27, 2016

I can work on this 😃

@0zguner
Copy link

0zguner commented Jan 27, 2016

I've looked at the docs of flexboxgrid ; It does not include this feature, am I wrong ? I think we should first contribute to flexboxgrid package for this feature. Any ideas ?

@roylee0704
Copy link
Owner

@mzgnr , yes you are right, indeed flexboxgrid.css doesn't support these features. I'm not sure if the author of flexboxgrid would want to have these features, but worth trying. :)

@boustanihani
Copy link
Author

I forgot that I already did a feature request, and there is also a pull request for this, but the author seems not willing to add this feature, check:

@0zguner
Copy link

0zguner commented Jan 27, 2016

I'm on this feature guys. I'll be back with this feature :)

@gingur
Copy link
Contributor

gingur commented Jan 29, 2016

I'm in the same boat, I'll be needing to use the bootstrap-ish responsive utils, but I feel that falls outside the scope of what this project was intended for. If the author of flexboxgrid refuses to add it, maybe an extension/utility lib could be implemented to expose that functionality and then wrapped similarly with React components as you guys have done in a separate optional repository.

@veeracs
Copy link

veeracs commented Mar 7, 2016

It's a feature that'll make more sense if it's added to a React component as opposed to flexboxgrid because we don't want to render the DOM in the first place based on a media query match and not because of a CSS media query.

@renato
Copy link

renato commented Mar 10, 2016

I've been using flex-grid (see VladShcherbin/flex-grid#1) in another project and looks like it's an unpretentious drop in replacement for flexboxgrid with visibility and stretch classes.

@shilpan
Copy link

shilpan commented Mar 28, 2016

Any updates on this?

@silvenon
Copy link
Collaborator

@shilpan I don't see how it's accurate to add visibility classes, since flexboxgrid doesn't have this feature, and react-flexbox-grid should just be a React wrapper around flexboxgrid. But I guess it wouldn't hurt 😁

@rcherem
Copy link

rcherem commented Apr 20, 2016

I guess this will solve it:

.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
  display: none !important;
}
@media (max-width: 48em) {
    .visible-xs      { display: block !important; }
    .row.visible-xs  { display: flex !important;
                       display: -webkit-flex !important;
                       display: -ms-flexbox !important;
                       display: -webkit-box !important;
                       display: flex!important; }
    table.visible-xs { display: table !important; }
    tr.visible-xs    { display: table-row !important; }
    th.visible-xs,
    td.visible-xs    { display: table-cell !important; }
}
@media (min-width: 48em) and (max-width: 62em) {
    .visible-sm      { display: block !important; }
    .row.visible-sm  { display: flex !important;
                       display: -webkit-flex !important;
                       display: -ms-flexbox !important;
                       display: -webkit-box !important;
                       display: flex!important; }
    table.visible-sm { display: table !important; }
    tr.visible-sm    { display: table-row !important; }
    th.visible-sm,
    td.visible-sm    { display: table-cell !important; }
}
@media (min-width: 62em) and (max-width: 75em) {
    .visible-md      { display: block !important; }
    .row.visible-md  { display: flex !important;
                       display: -webkit-flex !important;
                       display: -ms-flexbox !important;
                       display: -webkit-box !important;
                       display: flex!important; }
    table.visible-md { display: table !important; }
    tr.visible-md    { display: table-row !important; }
    th.visible-md,
    td.visible-md    { display: table-cell !important; }
}
@media (min-width: 75em) {
    .visible-lg      { display: block !important; }
    .row.visible-lg  { display: flex !important;
                       display: -webkit-flex !important;
                       display: -ms-flexbox !important;
                       display: -webkit-box !important;
                       display: flex!important; }
    table.visible-lg { display: table !important; }
    tr.visible-lg    { display: table-row !important; }
    th.visible-lg,
    td.visible-lg    { display: table-cell !important; }
}
@media (max-width: 48em)                       { .hidden-xs { display: none !important; } }
@media (min-width: 48em) and (max-width: 62em) { .hidden-sm { display: none !important; } }
@media (min-width: 62em) and (max-width: 75em) { .hidden-md { display: none !important; } }
@media (min-width: 75em)                       { .hidden-lg { display: none !important; } }

@carloscuatin
Copy link

You could use a high-level component to do this they think ?

@silvenon
Copy link
Collaborator

Closing this in favor of #57.

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

No branches or pull requests

10 participants