From 167685313d80cfa5995bd42c695204d1e014925c Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Mon, 4 Mar 2024 15:17:16 +0800 Subject: [PATCH] change theme switcher --- assets/css/dark.css | 5 +---- assets/css/light.css | 5 +---- assets/css/main.css | 17 ++++++++++------- layouts/partials/header.html | 3 ++- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/assets/css/dark.css b/assets/css/dark.css index ecb7024..a520c59 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -28,10 +28,7 @@ --post-info-color: grey; ---switcher-color: #333; ---switcher-bg-color: #fff; ---switcher-border-color: #333333 ---switcher-border-radius: 5px; +--switcher-color: #fff; --svg-color: #ccc; --svg-state-color:#ff5858; diff --git a/assets/css/light.css b/assets/css/light.css index df05b45..d2f4dcb 100644 --- a/assets/css/light.css +++ b/assets/css/light.css @@ -30,10 +30,7 @@ --post-info-color: grey; - --switcher-color: #fff; - --switcher-bg-color: #333; - --switcher-border-color: #eeeeee; - --switcher-border-radius: 5px; + --switcher-color: #333; --svg-color: #333; --svg-state-color: #a31d1d; diff --git a/assets/css/main.css b/assets/css/main.css index 07a2143..31f82df 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -234,6 +234,12 @@ header h2 { margin-top: 1em; } +.header-top-left { + display: flex; + align-items: center; + justify-content: space-between; +} + .site-title { display: inline; white-space: nowrap; @@ -258,7 +264,7 @@ header nav a { /* Social icons */ .social-icons { display: inline; - margin: 1em 0 0 3em; + margin: 1em 0 0 1em; padding: 0; list-style-type: none; } @@ -733,12 +739,9 @@ ul.language-select > li, ul.footer-menu > li { .theme-switcher { color: var(--switcher-color); - background: var(--switcher-bg-color); - padding: 0.5em 1em; - font-size: 16px; - border: 1px solid var(--switcher-border-color); - border-radius: var(--switcher-border-radius); - margin-bottom: 1em; + /* padding: 0.5em 1em; */ + margin: 1em 0 0 1.5em; + cursor: pointer; } .h-card { diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b7cbb02..a3a37cf 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,10 +1,11 @@
{{ partial "site-title.html" . }} + {{ partial "theme-switcher.html" . }} {{ partial "social.html" . }}
- {{ partial "theme-switcher.html" . }} +