-
-
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
@apply and @screen in plugins not working as expected #432
Comments
I tried using custom media queries having both @media (min-width: [object Object]) {
/* ... */
} // tailwind.config.js
module.exports = {
theme: {
screens: {
'sm': {'min': '640px', 'max': '767px'},
'md': {'min': '768px', 'max': '1023px'},
'lg': {'min': '1024px', 'max': '1279px'},
'xl': {'min': '1280px', 'max': '1535px'},
'2xl': {'min': '1536px'},
},
}
} |
Thanks for the great bug report ⚡ Looks like there's a bug here plus a few features that twin doesn't currently support:
|
Should I split this into three issues for better tracking (+ labelling)? PS: Yeah, I am also unable to find any official documentation on |
Yes please, thanks ahead :) |
i faced the same issue
have you solved this problem? and how? |
Description
I am unable to use
@apply
and@screen
in my custom plugins. The@apply
is being completely ignored, and the order of@screen
keys is not being respected.Even if I replace
@screen sm
with@media (min-width: 640px)
(and others too), the plugin is not working as expected. Although for@apply
, as a possible workaround, I am able to define CSS directly in the plugin or combine multiple classes directly usingtw
.My Plugin
JSX Code
Actual vs Expected Behavior
Actual
Expected
The media queries should have been in reverse order, i.e. in which the keys of the plugin are defined. And there should have been styles corresponding to
w-full mx-auto px-4 bg-black text-white py-8
also.Minimum Reproducible Example
https://github.com/brc-dd/twin-possible-bug
This repo is bootstrapped using the official Next.js example: with-tailwindcss followed by configuring it to use
twin.macro
as per the instructions given here.The text was updated successfully, but these errors were encountered: