detached c358943

fix(homepage): theme switching and background color issues

- Fix moon icon SVG rendering (replaced broken filled path with proper crescent)
- Use CSS variables for background colors instead of hardcoded hex values
- Remove redundant background-color from .homepage-shell to prevent dark border
- Refactor theme switching logic to use proper switch statement
- Ensure light/dark classes are properly toggled for both modes
commit
c3589435068c09e8f6c871a6d34819f700be9c20
author
bamen · · 2025-10-15 04:47 UTC
parent
db2c189
signature
unsigned
1 file · +13 -16
M gui/src/pages/Homepage.svelte +13 -16
@@ -549,10 +549,15 @@
549549 return;
550550 }
551551
552- if (mode === "dark") {
553- document.documentElement.classList.add("dark");
554- } else {
555- document.documentElement.classList.remove("dark");
552+ switch (mode) {
553+ case "light":
554+ document.documentElement.classList.add("light");
555+ document.documentElement.classList.remove("dark");
556+ break;
557+ case "dark":
558+ document.documentElement.classList.remove("light");
559+ document.documentElement.classList.add("dark");
560+ break;
556561 }
557562 persistTheme(mode);
558563 };
@@ -766,10 +771,8 @@
766771 <meta name="description" content="Fast Wayland Browser - Your browsing patterns at a glance" />
767772
768773 {@html `<style>
769- html { background: #0a0a0a; }
770- body { background: #0a0a0a; color: #e5e5e5; }
771- html.light { background: #ffffff; }
772- html.light body { background: #ffffff; color: #171717; }
774+ html { background: var(--dynamic-bg, #0a0a0a); }
775+ body { background: var(--dynamic-bg, #0a0a0a); color: var(--dynamic-text, #e5e5e5); }
773776 </style>`}
774777
775778 {@html `<script>
@@ -806,13 +809,8 @@
806809 {themeMode === "dark" ? "Switch to light mode" : "Switch to dark mode"}
807810 </span>
808811 {#if themeMode === "dark"}
809- <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
810- <path
811- fill="currentColor"
812- fill-rule="evenodd"
813- clip-rule="evenodd"
814- d="M17.293 13.293A8 8 0 0 1 10.707 2.997a8.001 8.001 0 1 0 6.586 10.296z"
815- />
812+ <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
813+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
816814 </svg>
817815 {:else}
818816 <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
@@ -1193,7 +1191,6 @@
11931191 <style>
11941192 .homepage-shell {
11951193 min-height: 100vh;
1196- background-color: var(--dynamic-bg);
11971194 color: var(--dynamic-text);
11981195 display: flex;
11991196 flex-direction: column;
@@ -549,10 +549,15 @@
549 return;549 return;
550 }550 }
551 551
552- if (mode === "dark") {552+ switch (mode) {
553- document.documentElement.classList.add("dark");553+ case "light":
554- } else {554+ document.documentElement.classList.add("light");
555- document.documentElement.classList.remove("dark");555+ document.documentElement.classList.remove("dark");
556+ break;
557+ case "dark":
558+ document.documentElement.classList.remove("light");
559+ document.documentElement.classList.add("dark");
560+ break;
556 }561 }
557 persistTheme(mode);562 persistTheme(mode);
558 };563 };
@@ -766,10 +771,8 @@
766 <meta name="description" content="Fast Wayland Browser - Your browsing patterns at a glance" />771 <meta name="description" content="Fast Wayland Browser - Your browsing patterns at a glance" />
767 772
768 {@html `<style>773 {@html `<style>
769- html { background: #0a0a0a; }774+ html { background: var(--dynamic-bg, #0a0a0a); }
770- body { background: #0a0a0a; color: #e5e5e5; }775+ body { background: var(--dynamic-bg, #0a0a0a); color: var(--dynamic-text, #e5e5e5); }
771- html.light { background: #ffffff; }
772- html.light body { background: #ffffff; color: #171717; }
773 </style>`}776 </style>`}
774 777
775 {@html `<script>778 {@html `<script>
@@ -806,13 +809,8 @@
806 {themeMode === "dark" ? "Switch to light mode" : "Switch to dark mode"}809 {themeMode === "dark" ? "Switch to light mode" : "Switch to dark mode"}
807 </span>810 </span>
808 {#if themeMode === "dark"}811 {#if themeMode === "dark"}
809- <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">812+ <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
810- <path813+ <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
811- fill="currentColor"
812- fill-rule="evenodd"
813- clip-rule="evenodd"
814- d="M17.293 13.293A8 8 0 0 1 10.707 2.997a8.001 8.001 0 1 0 6.586 10.296z"
815- />
816 </svg>814 </svg>
817 {:else}815 {:else}
818 <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">816 <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
@@ -1193,7 +1191,6 @@
1193 <style>1191 <style>
1194 .homepage-shell {1192 .homepage-shell {
1195 min-height: 100vh;1193 min-height: 100vh;
1196- background-color: var(--dynamic-bg);
1197 color: var(--dynamic-text);1194 color: var(--dynamic-text);
1198 display: flex;1195 display: flex;
1199 flex-direction: column;1196 flex-direction: column;

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close