[Feature Proposal] Prefers Color Scheme variants #1145
Replies: 9 comments
-
This would probably work better as a plugin? |
Beta Was this translation helpful? Give feedback.
-
You can already define your own media queries on screens: {
dark: { raw: '(prefers-color-scheme: dark)' },
light: { raw: '(prefers-color-scheme: light)' },
}, |
Beta Was this translation helpful? Give feedback.
-
Is there anyway to add a screen from a plugin? Seems like there isn't. |
Beta Was this translation helpful? Give feedback.
-
Nope. Convo at #660. |
Beta Was this translation helpful? Give feedback.
-
@hacknug I actually use the same approach - works really well! Does anyone know however, how to combine multiple screen queries? Something like |
Beta Was this translation helpful? Give feedback.
-
@agcty I don't think that's possible, should use a variant for it or add new screens for each breakpoint + dark/light combo. Just make sure you use Also I think we could now turn this into a plugin that takes the user |
Beta Was this translation helpful? Give feedback.
-
@hacknug That's a great idea! I have limited knowledge about plugins at this moment so it's probably a better idea if you gave it a shot. 😅 |
Beta Was this translation helpful? Give feedback.
-
@hacknug @agcty |
Beta Was this translation helpful? Give feedback.
-
https://tailwindcss.com/docs/dark-mode Tailwind 2+ supports the media query out of the box with a |
Beta Was this translation helpful? Give feedback.
-
I would love to hook prefers-color-scheme into Tailwind and use it like:
dark:bg-gray-900
orlight:bg-gray-100
.The support for it is growing and there would be no harm if a browser had no support for it.
I was thinking about creating a PR myself with this functionality (no clue yet about how) but by reading the contributing guidelines I saw that I should open an issue first, so here it is :)
What do you think about it? Should it sit at the core?
Beta Was this translation helpful? Give feedback.
All reactions