remark42 toggle theme
This commit is contained in:
parent
a81f284f29
commit
0d20295d3f
@ -21,15 +21,16 @@
|
|||||||
}
|
}
|
||||||
})(remark_config.components || ['embed']);
|
})(remark_config.components || ['embed']);
|
||||||
|
|
||||||
|
var toggleComments = function () {
|
||||||
|
|
||||||
</script>
|
if (document.getElementById("toggle-dark").checked == true) {
|
||||||
|
|
||||||
<div id="remark42"></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
window.onload = function () {
|
|
||||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
||||||
window.REMARK42.changeTheme('dark');
|
window.REMARK42.changeTheme('dark');
|
||||||
|
} else {
|
||||||
|
window.REMARK42.changeTheme('light');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div id="remark42">
|
||||||
|
<input type="checkbox" name="toggle-dark" onchange="toggleComments()">
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user