summaryrefslogtreecommitdiff
path: root/layout/_partial/head.ejs
diff options
context:
space:
mode:
author135e2 <[email protected]>2022-05-29 17:18:06 +0800
committer135e2 <[email protected]>2022-06-03 11:30:43 +0800
commitc02c983166effdb5db4578e4ab45f58762f082d4 (patch)
tree5ba85cfe3672a04143718153697f7790e6fbdd14 /layout/_partial/head.ejs
parenteb8a7b323891b870ddda677fa43e583c7477803d (diff)
downloadchromate-c02c983166effdb5db4578e4ab45f58762f082d4.tar.gz
chromate-c02c983166effdb5db4578e4ab45f58762f082d4.tar.bz2
chromate-c02c983166effdb5db4578e4ab45f58762f082d4.zip
feat: add #btn-toggle-dark botton to toggle dark mode
- Switch dark theme to bulmaswatch/darkly, since bulma-prefers-dark highly relies on `@media: (prefers-color-scheme: dark)` tag - Add a playerman handler to toggle shikwasa theme[1] - Use localstorage to store user's preference[2] - Fix a typo: SystemDarkmodePrefrence => SystemDarkmodePreference [1]: Modified from https://github.com/jessuni/shikwasa/blob/main/pages/public/index.js#L208 [2]: Took inspiration from https://blog.skk.moe/post/hello-darkmode-my-old-friend
Diffstat (limited to 'layout/_partial/head.ejs')
-rw-r--r--layout/_partial/head.ejs4
1 files changed, 2 insertions, 2 deletions
diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs
index e56722d..54ec4c0 100644
--- a/layout/_partial/head.ejs
+++ b/layout/_partial/head.ejs
@@ -33,6 +33,6 @@
<!-- Scripts and styles -->
<%- css('css/style.min.css') %>
- <link rel="stylesheet" href="https://cdn.staticfile.org/bulma/0.9.4/css/bulma.min.css">
- <link media="(prefers-color-scheme: dark)" rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jloh/bulma-prefers-dark/css/bulma-prefers-dark.min.css">
+ <link rel="stylesheet" id="bulma-light" href="https://cdn.jsdelivr.net/npm/bulma/css/bulma.min.css">
+ <link rel="stylesheet" id="bulma-dark" href="https://cdn.jsdelivr.net/npm/[email protected]/darkly/bulmaswatch.min.css">
</head>