-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support for advanced screens #21
Comments
Hey @nathan3000 I have added support for this on the import _utils from 'tailwind.macro/utils'
import _config from './tailwind.config.js'
let styles = {
[_util.stringifyScreen(_config, 'sm')]: {
textTransform: 'uppercase'
}
} I will try to publish this under the |
Leaving this here for anyone working with the beta for tailwind v1 since the config's are now merged and the example above won't work if your not duplicating the default screen values. Took me a while to figure out the syntax, but this is how ya do it (using styled components)
|
@llaski Hey. The code in my previous comment is an example of what the babel plugin outputs. You wouldn’t actually write code like that yourself. Assuming you’re using import tw from 'tailwind.macro'
const StyledComponent = tw.div`text-red-500` |
@bradlc I should have specified my use case more clearly. I needed direct access to the screen size because from what I could tell there isn't a way to use the directives from tailwind in combination with styled components. For example I would love to be able to do something like this:
So the above is my workaround to replicate the directive so I don't duplicate the source of truth for screen sizes. |
Tailwind has support for advanced screens with
min-width
andmax-width
media queries. This plugin only seems to supportmin-width
.Advanced Screens - documentation
I had a look at fixing the issue but I can't see how it could work in development when the config isn't being loaded and therefore can't be inspected:
The text was updated successfully, but these errors were encountered: