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
Add support for @screen directive and custom media queries #715
Comments
There's unocss/test/preset-uno.test.ts Lines 28 to 30 in e079cb3
unocss/packages/preset-wind/src/theme.ts Lines 156 to 174 in e079cb3
Edit. I realized the issue is about directive support, and may require additional logic. But currently using media with existing rule should be supported . Ex. |
/cc @hannoeru if you are interested in it 👀 |
Just updating here in case anyone is looking for a workaround. I've been using https://github.com/postcss/postcss-custom-media which feels better to me than creating non standard directives, as it follows the W3G spec. Maybe we could just document somewhere to use postcss instead of implementing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Resolved on #1434 |
Adding screens under breakpoints doesn't seem to work... they are totally ignored |
You can check the docs or our test code. |
@chris-zhu Apply works perfecty, I was talking about applying custom media queries, I did this through unocss.config... With breakpoints everything works fine except screens, in the docs I haven't found anything related What I am trying to do:
Tailwind docs that I'am trying to follow https://tailwindcss.com/docs/screens#custom-media-queries I also tried with |
In our theme, we don't have |
Max width doesn't seem to work inside breakpoints. How I can set max width instead of min width in unocss? |
We have |
Thank you for your time and help, i managed to create a custom rule 😁 I share it just in case someone may need it
|
Where does |
import { defineConfig, toEscapedSelector as e } from 'unocss' or replace |
Would love to see the "@screen" directive being implemented :
In my opinion, the most useful feature would be the ability to use custom media queries with
@screen
like this(currently this works with tailwind/windi)
Then this can be used in styles like this :
and it gets transformed into the following css :
The text was updated successfully, but these errors were encountered: