:where(html.is-light) a {
color: black;
}
:where(html.is-dark) a {
color: white;
}
Then it will not respect the user's preferred color scheme specified via system settings.
So we also need to use prefers-color-scheme media query.
This plugin already can transform prefers-color-scheme, so if we convert this:
a {
color: light-dark(black, white);
}
To this:
@media (prefers-color-scheme: dark) {
a {
color: white;
}
}
@media (prefers-color-scheme: light) {
a {
color: black;
}
}
then the current plugin code will run and we will get the following:
@media (prefers-color-scheme: dark) {
:where(html:not(.is-light)) a {
color: white;
}
}
:where(html.is-dark) a {
color: white;
}
@media (prefers-color-scheme: light) {
:where(html:not(.is-dark)) a {
color: black;
}
}
:where(html.is-light) a {
color: black;
}
Closes #25
If we try to convert code from this:
To this:
Then it will not respect the user's preferred color scheme specified via system settings. So we also need to use
prefers-color-scheme
media query. This plugin already can transformprefers-color-scheme
, so if we convert this:To this:
then the current plugin code will run and we will get the following: