-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add grid support for multiple device visibility breakpoints? #1024
Comments
I think we should support both of these features. Here are my thoughts. Allow an
|
maybe |
Another possibility is to standardize the string <Grid.Column largeScreen='5' />
<Grid.Column only='largeScreen' />
<Grid.Column only='computer largeScreen' /> I like |
The downside to |
I've marked this as ready for development. Let's go ahead and get this going: Multiple <Grid.Column only='tablet mobile' />
//=> <div class="column tablet only mobile only"></div>
<Grid.Column only='desktop large screen' />
//=> <div class="column desktop only large screen only"></div> Sugar for <Grid.Column onlyLarger='desktop' />
//=> <div class="column large screen only"></div>
<Grid.Column onlySmaller='desktop' />
//=> <div class="column tablet only mobile only"></div> |
Currently, you can specify only one value for the
only
device visibility prop on<Grid.Column/Row>
. One accepted value istablet mobile
.This means if I want a
<Row>
to be visible for both tablet and computer devices, I need to either duplicate the markup with differentonly
props or manually specifyclassName="only tablet only computer"
which works but is not ideal.Is there a reason we can't support something like:
<Grid.Row only={['tablet', 'computer']}>
or<Grid.Row only="tablet computer">
Multiple values like this works in practice using the SUI css.
I think it's a very common use case to have a column visible for all devices larger than X and another column hidden for everything smaller than Y. Or am I missing something in SUI that gives you this greater than/less than ability? It's seems awkward to need to list all device sizes when I all I want is bigger/smaller than.
The text was updated successfully, but these errors were encountered: