Closed argyleink closed 2 years ago
Is it possible to place the dark mode props under a specific class or attribute selector, instead of placing them into a media query? I have a theme toggle that updates a root data-attribute and class upon a toggle change event so placing the css variables into a prefers-color-scheme media query won't work.
I'm wondering if an option could be added to the plugin to specify where the props get placed (default: media query, custom: [data-attr
, #id
, .class
, etc]), similar to the option to insert the props into a specified layer. The current -@media:dark
syntax could be maintained if the plugin created the specified selectors instead of outputting props under the root selector in a media query.
this is a very meaningful feature request! logged the feature request here https://github.com/GoogleChromeLabs/postcss-jit-props/issues/44
fixes #11
todo: