diff options
author | Doge <[email protected]> | 2021-05-08 01:58:02 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-08 01:58:02 +0800 |
commit | 45265444c24fc2439c9769d9151a6bf560f22575 (patch) | |
tree | 42579c0a1d45e47a32b4b8369704d3ab17c4db35 | |
parent | d10d58fe931e2f42ad4e9f6b0cc98c03eeedc125 (diff) | |
download | chromate-45265444c24fc2439c9769d9151a6bf560f22575.tar.gz chromate-45265444c24fc2439c9769d9151a6bf560f22575.tar.bz2 chromate-45265444c24fc2439c9769d9151a6bf560f22575.zip |
Minor bug fixes
-rw-r--r-- | layout/_partial/head.ejs | 1 | ||||
-rw-r--r-- | layout/_partial/scripts.ejs | 27 | ||||
-rw-r--r-- | layout/post.ejs | 2 | ||||
-rw-r--r-- | source/css/style.css | 2 |
4 files changed, 17 insertions, 15 deletions
diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 1206434..3d4ee79 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -21,5 +21,6 @@ <!-- Scripts and styles --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma/css/bulma.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css"> + <link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" /> <%- css("css/style.css") %> </head>
\ No newline at end of file diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index a60011f..c07d83d 100644 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -11,7 +11,6 @@ <% } %> <!-- Darkmode support --> -<link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" /> <%- js('js/darkmode.js') %> <script> var darklistener = new DarkmodeListener(); @@ -25,18 +24,20 @@ <link id="highlight-dark-theme" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/styles/<%= theme.highlight.darkmode %>.min.css"> <script> - const theme_selector = (mode) => { - if (mode === SystemDarkmodePrefrence.dark) { - document.getElementById("highlight-light-theme").setAttribute("disabled", "disabled"); - document.getElementById("highlight-dark-theme").removeAttribute("disabled"); - } else { - document.getElementById("highlight-dark-theme").setAttribute("disabled", "disabled"); - document.getElementById("highlight-light-theme").removeAttribute("disabled"); - } - }; - theme_selector(darklistener.mode()); - darklistener.add(theme_selector); - hljs.initHighlightingOnLoad(); + window.addEventListener("load", () => { + const theme_selector = (mode) => { + if (mode === SystemDarkmodePrefrence.dark) { + document.getElementById("highlight-light-theme").setAttribute("disabled", "disabled"); + document.getElementById("highlight-dark-theme").removeAttribute("disabled"); + } else { + document.getElementById("highlight-dark-theme").setAttribute("disabled", "disabled"); + document.getElementById("highlight-light-theme").removeAttribute("disabled"); + } + }; + theme_selector(darklistener.mode()); + darklistener.add(theme_selector); + hljs.initHighlightingOnLoad(); + }, false); </script> <% } %> diff --git a/layout/post.ejs b/layout/post.ejs index e0eed90..ae30353 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -1,4 +1,4 @@ -<article class="post"> +<article class="post content"> <!-- Post thumbnail with lazayload support --> <div class="post-thumbnail" style="background-image: url('<%= page.thumbnail %>');"></div> diff --git a/source/css/style.css b/source/css/style.css index 1fe0a0e..60e5df1 100644 --- a/source/css/style.css +++ b/source/css/style.css @@ -1,3 +1,3 @@ pre { - background-color: inherit !important; + background-color: none !important; }
\ No newline at end of file |