change remark42 theme based on browser theme
This commit is contained in:
parent
2272ba9ebf
commit
a956b3ae95
@ -1,26 +1,32 @@
|
||||
<script>
|
||||
var remark_config = {
|
||||
host: "https://remark42.kottedi.in",
|
||||
site_id: 'remark',
|
||||
secret: 'abcdefgh@4356',
|
||||
components: ['embed'],
|
||||
|
||||
max_shown_comments: 10,
|
||||
theme: 'light',
|
||||
|
||||
locale: 'en',
|
||||
show_email_subscription: false
|
||||
host: "https://remark42.kottedi.in",
|
||||
site_id: 'remark',
|
||||
secret: 'abcdefgh@4356',
|
||||
components: ['embed'],
|
||||
|
||||
max_shown_comments: 10,
|
||||
theme: 'light',
|
||||
|
||||
locale: 'en',
|
||||
show_email_subscription: false
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
(function(c) {
|
||||
for(var i = 0; i < c.length; i++){
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' +c[i] +'.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
(function (c) {
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' + c[i] + '.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
})(remark_config.components || ['embed']);
|
||||
</script>
|
||||
|
||||
window.onload = function () {
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
window.REMARK42.changeTheme('dark');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="remark42"></div>
|
||||
Loading…
Reference in New Issue
Block a user