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 Proposal - @responsive max-width #470

Closed
gofish543 opened this issue May 19, 2018 · 3 comments
Closed

Feature Proposal - @responsive max-width #470

gofish543 opened this issue May 19, 2018 · 3 comments

Comments

@gofish543
Copy link

I did some reading and this feature does not appear to be present within the most recent versions of tailwind.

What would be nice is if there was a way to do

@responsive-max {
    .display {
        display: none;
    }
}

Which would yield...

@media (max-width: 576px) {
    .sm\:display {
        display: none;
    }
}

@media (max-width: 768px) {
    .md\:display {
        display: none;
    }
}

@media (max-width: 992px) {
    .lg\:display {
        display: none;
    }
}

@media (max-width: 1200px) {
    .xl\:display {
        display: none;
    }
}
@hacknug
Copy link
Contributor

hacknug commented May 22, 2018

Duplicate of #355

Also, the problem with using the same value for max-width is that you'd have overlapping between breakpoints. This is pretty easy to fix with pixel breakpoints but not as straightforward when it comes to other units.

@adamwathan
Copy link
Member

@gofish543 So you can actually already create max-width based breakpoints:

https://tailwindcss.com/docs/responsive-design/#advanced-screens

If you wanted min-width and max-width you'd just need to come up with names for them. Similar discussion here:

tailwindlabs/discuss#139

@gofish543
Copy link
Author

@adamwathan I should’ve looked at the documentation a little bit more. I apologize.

Thanks for the help!

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

No branches or pull requests

3 participants