-
-
Notifications
You must be signed in to change notification settings - Fork 185
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 custom breakpoints #6
Comments
Hey Benett, thanks for giving the new package a trial. If you've added your custom breakpoints to the config then you can use them with tailwind classes as normal: tw.div`grid grid-cols-1 desktop:grid-cols-4` // tailwind.config.js
module.exports = {
theme: {
screens: {
tablet: '640px',
laptop: '1024px',
desktop: '1280px'
},
}
} |
If you're using them in a styled block then it's a little more complex. For now, something like this should work: // tailwind.helpers.js
import _get from 'lodash/get';
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfig from '~./../../tailwind.config.js';
const { theme } = resolveConfig(tailwindConfig);
const SCREEN = _get(theme, 'borderColor.screens');
export { SCREEN }; |
Thanks for replying so quickly. I'm trying to use the I just gave your above suggestion a try, but I'm running into a problem that I've seen before: the I'll mess with it a bit more, but if I can't get this to work I may just fall back to using Tailwind separate SCSS files for cases where I need to use Tailwind directives. Thanks again! |
I've run into that issue before and think I fixed it with the advice on that issue.
|
Take a look at the |
Thanks for making this module! I've been hoping to use the newer releases of Tailwind with Emotion.
I'm trying to use my custom
@screen
breakpoints with the macro, but can only seem to get the default breakpoints to work.I'm using the approach mentioned by @llaski on this thread, by calling the
_utils.stringifyScreen
function. I recognize that this may not be intended as a public function, but it does work for the default breakpoints. Is there a way to have it recognize my custom breakpoints defined under my Tailwind config?The text was updated successfully, but these errors were encountered: