Open akellbl4 opened 2 years ago
Sorry, so can it be fixed? Because the related issue was closed unresolved: https://github.com/umputun/remark42/issues/1662
Currently I see this:
as a workaround, i have added the autoswitch by using:
theme: window.matchMedia && window.matchMedia('(prefers-color-scheme:dark)').matches ? "dark" : "light",
to let it change automatically if you switch from light to dark without reloading the page i've added:
window.matchMedia('(prefers-color-scheme:dark)').addEventListener('change', event => {
const newColorScheme = event.matches ? "dark" : "light";
window.REMARK42.changeTheme(newColorScheme);
});
to it. maybe you can add it directly into remark with the "auto" tag
it works perfectly like this on my blog
color-scheme: light dark
when the param istrue
, addlight
ordark
whenfalse
and switchcoloe-scheme
value accordinglyCases
Auto
Add support for auto switch between themes
Dark
Light