From a6b3c6be500c382dc93774dec801c95b233b0a47 Mon Sep 17 00:00:00 2001 From: vinayak19th Date: Sun, 17 Aug 2025 04:15:24 +0000 Subject: [PATCH 1/2] feat: moved theme toggle next to search bar --- .devcontainer/devcontainer.json | 2 +- _includes/sidebar.html | 10 --- _includes/topbar.html | 67 ++++++++++++++----- _javascript/modules/components/mode-toggle.js | 4 +- _sass/base/_base.scss | 1 + _sass/layout/_sidebar.scss | 6 +- _sass/layout/_topbar.scss | 4 ++ 7 files changed, 58 insertions(+), 36 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 39c428df4ea..1f29a96a69a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,4 +26,4 @@ ] } } -} +} \ No newline at end of file diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 569585f6f24..ee50a947470 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -41,16 +41,6 @@ + {% comment %} Container for buttons {% endcomment %} +
+ {% unless site.theme_mode %} + + {% endunless %} + - - - - - - - + + + + + + {% comment %} Theme button {% endcomment %} +
+ + diff --git a/_javascript/modules/components/mode-toggle.js b/_javascript/modules/components/mode-toggle.js index 455ff0a02dc..708c2830081 100644 --- a/_javascript/modules/components/mode-toggle.js +++ b/_javascript/modules/components/mode-toggle.js @@ -2,9 +2,9 @@ * Add listener for theme mode toggle */ -const $toggle = document.getElementById('mode-toggle'); - export function modeWatcher() { + const $toggle = document.getElementById('mode-toggle'); + console.log('Mode watcher initialized'); if (!$toggle) { return; } diff --git a/_sass/base/_base.scss b/_sass/base/_base.scss index 46e9eb6e83f..b0def61bbd8 100644 --- a/_sass/base/_base.scss +++ b/_sass/base/_base.scss @@ -4,6 +4,7 @@ @use '../abstracts/placeholders'; @use '../themes/light'; @use '../themes/dark'; +@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"); :root { font-size: 16px; diff --git a/_sass/layout/_sidebar.scss b/_sass/layout/_sidebar.scss index eaad470c6c4..68d0667c080 100644 --- a/_sass/layout/_sidebar.scss +++ b/_sass/layout/_sidebar.scss @@ -225,11 +225,7 @@ $sidebar-display: 'sidebar-display'; /* the attribute for sidebar display */ line-height: $btn-size; } - #mode-toggle { - @extend %button; - @extend %sidebar-links; - @extend %sidebar-link-hover; - } + .icon-border { @extend %no-cursor; diff --git a/_sass/layout/_topbar.scss b/_sass/layout/_topbar.scss index eb0aea9b0ca..083d58366df 100644 --- a/_sass/layout/_topbar.scss +++ b/_sass/layout/_topbar.scss @@ -14,6 +14,10 @@ } } +#mode-toggle { + margin-right: 1.5rem; + } + #topbar { @extend %btn-color; From 4c179382530aa472715d366216263b202738ad25 Mon Sep 17 00:00:00 2001 From: Vinayak Sharma Date: Sat, 16 Aug 2025 21:33:22 -0700 Subject: [PATCH 2/2] fix: fixed scss import formatting Signed-off-by: Vinayak Sharma --- _sass/base/_base.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/base/_base.scss b/_sass/base/_base.scss index b0def61bbd8..fbe98aaec9a 100644 --- a/_sass/base/_base.scss +++ b/_sass/base/_base.scss @@ -4,7 +4,7 @@ @use '../abstracts/placeholders'; @use '../themes/light'; @use '../themes/dark'; -@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"); +@import "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"; :root { font-size: 16px;