change remark42 theme based on browser theme

This commit is contained in:
Bangara Raju Kottedi 2023-07-23 02:57:59 +05:30
parent 2272ba9ebf
commit a956b3ae95

View File

@ -21,6 +21,12 @@
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
window.onload = function () {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
window.REMARK42.changeTheme('dark');
}
}
</script>
<div id="remark42"></div>