-
Notifications
You must be signed in to change notification settings - Fork 496
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
Custom media query breakpoints #1133
base: master
Are you sure you want to change the base?
Conversation
Add ability to pass custom media query breakpoints
This looks great, something our team was actively talking about today! |
Thanks for putting this together! While this is an interesting idea, I don't know that it fits in well with the core concept of the responsive array prop. I think limiting the media queries to responsive "mobile-first" is really part of the core idea here. Since |
@jxnblk It might be that |
@aulneau I might not understand what you're referring to but isn't that deprecated? |
@jxnblk oh dang you're right! haha. well, I think regardless I'm curious about how to achieve the ability to pass different types of media queries in a scalable, repeatable way with styled-system -- which I think this PR is trying to get at. I don't mean to hijack this PR, so happy to create an issue, too. We explored using const Boop = styled('div')(
css({
px: 6,
'@media screen... etc': {
px: 8,
},
})
) |
So for a little more context, this PR opens up the possibility for a variety of different media queries (such as |
Would love to see support for customizing this too, the documentation states that this is actually possible, but right now it isn't. I'm experimenting with Styled System's responsiveness / breakpoints on Expo (React Native and React Native for Web) by implementing react-native-extended-stylesheet in Styled Components. Extended Stylesheet doesn't have support for 'screen and' type properties in the media queries, so I need to forcefully remove it now in my styled-components fork, which isn't ideal. |
This PR is about a month old now-- @jxnblk do you still have reservations about the intent of this pull request? This adds some features that I'm looking for, as well. |
@jxnblk Bump. This is a feature my team relies on, so we've been running off a fork for the past 3+ months. Let me know if there are any concerns/fixups I can make to this PR, or if there's a recommended alternative. Thanks! |
@jxnblk Bump. Let me know what I can do to make this merge a reality. |
Also keen to see this go through |
@jxnblk ^ |
Allows consumers to have more control over the media queries that get matched against by allowing custom
@media ...
queries in place of basicem
rule matching. For example, these rules can be used to distinguish touch/mobile devices usingpointer: coarse
Media queries can be used in a
breakpoints
array and matched against:breakpoints
can also be an object with media queries as the keysBoth
style
s above are equivalent to: