We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
color-scheme: light dark
true
light
dark
false
coloe-scheme
var remark_config = { theme: 'auto' }
color-scheme: light dark;
Add support for auto switch between themes
var remark_config = { theme: 'dark' }
color-scheme: dark;
var remark_config = { theme: 'light' }
color-scheme: light;
The text was updated successfully, but these errors were encountered:
Sorry, so can it be fixed? Because the related issue was closed unresolved: #1662
Currently I see this:
Sorry, something went wrong.
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
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: