-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
🐛 BUG: tailwind media queries are in the wrong order on astro dev
when using custom style.css
#4192
Comments
using a direct import
instead of a style import
and switching So it seems that my setup was wrong. |
I still have the issue with @media (min-width: 768px) {
...
}
@media (min-width: 640px) {
...
}
@media (min-width: 1024px) {
...
}
@media (min-width: 1280px) {
...
} This is working well with |
Also having this same issue with building Tailwind classes in Astro ^1.4.2, I'm using a custom set of screen sizes: screens: {
tablet: { 'max': '1024px' },
mobile: { 'max': '720px' },
}, This is compiling out as: @media (min-width: 720px) {
...
}
@media (min-width: 1024px) {
...
} Which is creating problems for certain parts of the website. |
Is there a fix for this that keeps compress css functionality? |
This is the correct order. Media queries are ordered by mobile first, notice the |
Did you notice that it's not in ascending order? 640px is after 768px in the code you quoted. |
What version of
astro
are you using?1.0.0-rc.7
Are you using an SSR adapter? If so, which one?
none
What package manager are you using?
yarn
What operating system are you using?
archlinux
Describe the Bug
I have an astro site with tailwind and a custom
style.css
file like this:which is imported in my main layout like this:
Some generated media-queries are in the wrong order when running
astro dev
(onbuild
everything seems fine).I tried the various RC and apparently this happens since RC4 (RC3 has no issue with this setup).
Looking at the changelog, it could be related to #4115
It is also possible that my setup is wrong (when I add
applyBaseStyles: false
to the config, no media-queries is working at all).When trying to create a reproducible example, I realized, that this happens only on
layouts/main.astro
(the same classes onpages/index.astro
don't have this issue):Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-hwexlu?file=src/pages/markdown-page.md
Participation
The text was updated successfully, but these errors were encountered: