-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Reusable Media Queries with String Styles wasn't working #533
Conversation
Was missing min-width in the media query construction
docs/media-queries.md
Outdated
@@ -95,7 +95,7 @@ const mq = Object.keys(breakpoints).reduce( | |||
typeof breakpoints[label] === 'string' ? '' : 'px' | |||
accumulator[label] = cls => | |||
css` | |||
@media (${breakpoints[label] + suffix}) { | |||
@media (min-width:${breakpoints[label] + suffix}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I rewrote this while changing the docs and should've tested it better, this change breaks for the string case though, could you change it to something like this?
let prefix = typeof breakpoints[label] === 'string' ? '' : 'min-width:'
// in the media query interpolation
prefix + breakpoints[label] + suffix
Updated with reference to the comments made by @mitchellhamilton. The Prefix is now determined by whether the value is a string or not
Reusable Media Queries with String Styles wasn't working:2
I'm new to contributing to other projects so I hope I have done the right things GitHub wise. But it looks like the changes made with reference to your comment @mitchellhamilton is there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!!
I found an issue with the Reusable Media Queries with String Styles example on the website, however when I add min-width: as shown in the pull request it began to work.
I am not sure if the changes I have made are a sufficient fix to update the website but I have updated media-queries.md
Thanks,
Adam