postcss / postcss-dark-theme-class

PostCSS plugin to make dark/light theme switcher by copying styles from media query to special class
MIT License
160 stars 16 forks source link

Fix light-dark #27

Closed VladBrok closed 8 months ago

VladBrok commented 8 months ago

The previous regex for light-dark was not taking into account values with variables and css color functions such as:

light-dark(rgb(0, 0, 0), var(--color))

Also, nested light-dark was not supported (we need to recursively "unwrap" light-dark in this case). Although using this syntax does not make any sense because this:

light-dark(light-dark(white, red), red)

is equivalent to this:

light-dark(white, red)

but this syntax is valid that's why we need to support it

ai commented 8 months ago

Thanks. Released in 1.2.1.