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