From a956b3ae95b35bb4a1efcd46e61ce9d38fa73bd9 Mon Sep 17 00:00:00 2001 From: Bangara Raju Kottedi Date: Sun, 23 Jul 2023 02:57:59 +0530 Subject: [PATCH] change remark42 theme based on browser theme --- _includes/comments/remark42.html | 46 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/_includes/comments/remark42.html b/_includes/comments/remark42.html index 2ac5701..1ce2c74 100644 --- a/_includes/comments/remark42.html +++ b/_includes/comments/remark42.html @@ -1,26 +1,32 @@ - + + + window.onload = function () { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + window.REMARK42.changeTheme('dark'); + } + } +
\ No newline at end of file