diff options
author | Doge <[email protected]> | 2021-05-10 00:28:12 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-10 00:28:12 +0800 |
commit | 37af3922761fd0c982ba2ffec11bfa1850269702 (patch) | |
tree | 83e019ed749eb610833854c2c5accc95677db61e | |
parent | b481a882fdfb55783618af0c1380faba959f6f11 (diff) | |
download | chromate-37af3922761fd0c982ba2ffec11bfa1850269702.tar.gz chromate-37af3922761fd0c982ba2ffec11bfa1850269702.tar.bz2 chromate-37af3922761fd0c982ba2ffec11bfa1850269702.zip |
Enhance autodark working
-rw-r--r-- | layout/_partial/header.ejs | 2 | ||||
-rw-r--r-- | layout/index.ejs | 8 | ||||
-rw-r--r-- | source/js/script.js | 4 | ||||
-rw-r--r-- | source/js/script.ts | 4 |
4 files changed, 7 insertions, 11 deletions
diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index c6c1a9f..f9463f7 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -1,4 +1,4 @@ -<section id="header-page" class="hero is-light is-large"> +<section class="hero is-large auto-dark"> <div class="hero-head"> <header class="navbar" aria-label="main navigation"> <div class="container"> diff --git a/layout/index.ejs b/layout/index.ejs index 93f15af..1a506a6 100644 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -96,14 +96,14 @@ <div class="column is-8 is-offset-2"> <nav class="pagination is-centered" role="navigation" aria-label="pagination"> <% if (page.prev) { %> - <a class="button is-light" href="<%- url_for(page.prev_link) %>"><%- __("prev") %></a> + <a class="button auto-dark" href="<%- url_for(page.prev_link) %>"><%- __("prev") %></a> <% } else { %> - <a class="button is-disabled is-light" disabled><%- __("prev") %></a> + <a class="button is-disabled auto-dark" disabled><%- __("prev") %></a> <% } %> <% if (page.next) { %> - <a class="button is-light" href="<%- url_for(page.next_link) %>"><%- __("next") %></a> + <a class="button auto-dark" href="<%- url_for(page.next_link) %>"><%- __("next") %></a> <% } else { %> - <a class="button is-disabled is-light" disabled><%- __("next") %></a> + <a class="button is-disabled auto-dark" disabled><%- __("next") %></a> <% } %> </nav> </div> diff --git a/source/js/script.js b/source/js/script.js index 21eda5d..ae91858 100644 --- a/source/js/script.js +++ b/source/js/script.js @@ -17,9 +17,7 @@ window.addEventListener("load", function () { } // Add header hover page class changer var colorman = function (mode) { - var clsname = ".is-light"; - if (darklistener.mode() === SystemDarkmodePrefrence.dark) - clsname = ".is-dark"; + var clsname = ".auto-dark"; var elements = Array.prototype.slice.call(document.querySelectorAll(clsname), 0); elements.forEach(function (element) { if (mode === SystemDarkmodePrefrence.dark) { diff --git a/source/js/script.ts b/source/js/script.ts index 7bfdda5..e6a2155 100644 --- a/source/js/script.ts +++ b/source/js/script.ts @@ -18,9 +18,7 @@ window.addEventListener("load", () => { // Add header hover page class changer const colorman = (mode: SystemDarkmodePrefrence) => { - let clsname: string = ".is-light"; - if (darklistener.mode() === SystemDarkmodePrefrence.dark) - clsname = ".is-dark"; + let clsname: string = ".auto-dark"; const elements: Element[] = Array.prototype.slice.call( document.querySelectorAll(clsname), 0); elements.forEach((element) => { |