-
-
Notifications
You must be signed in to change notification settings - Fork 961
feat: dark/light mode toggle + scrollbar white-space fix (Issue #1639) #1697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,6 +51,10 @@ textarea { | |||||||
| --color-neutral-10-rgb: 255, 255, 255; | ||||||||
| --color-neutral-100-rgb: 0, 0, 0; | ||||||||
|
|
||||||||
| --scrollbar-size: 12px; | ||||||||
| --scrollbar-track: rgba(var(--color-neutral-10-rgb), 0.08); | ||||||||
| --scrollbar-thumb: var(--color-brand-primary); | ||||||||
|
|
||||||||
|
Comment on lines
+54
to
+57
|
||||||||
| --scrollbar-size: 12px; | |
| --scrollbar-track: rgba(var(--color-neutral-10-rgb), 0.08); | |
| --scrollbar-thumb: var(--color-brand-primary); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,10 @@ const useStyle = makeStyles({ | |
| fontWeight: 600 | ||
| }, | ||
| Button: { | ||
| background: '#00f2fe', | ||
| background: 'var(--color-brand-primary)', | ||
| color: '#ffffff', | ||
| '&:hover': { | ||
| background: '#00f2fe', | ||
| background: 'var(--color-brand-primary)', | ||
| color: '#ffffff' | ||
|
Comment on lines
+13
to
17
|
||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,14 +3,13 @@ | |||||||||||
| top: 0; | ||||||||||||
| right: 0; | ||||||||||||
| left: 0; */ | ||||||||||||
| transition: transform 0.3s ease; | ||||||||||||
| transition: transform 0.3s ease, background-color 0.2s ease, color 0.2s ease; | ||||||||||||
| z-index: 10; | ||||||||||||
| display: flex; | ||||||||||||
| justify-content: space-between; | ||||||||||||
| align-items: center; | ||||||||||||
| /* background: rgba(var(--color-brand-primary-rgb), 0.08); */ | ||||||||||||
| background: var(--color-neutral-90); | ||||||||||||
| color: #fff; | ||||||||||||
| background: var(--color-neutral-10); | ||||||||||||
| color: var(--color-neutral-80); | ||||||||||||
| height: 64px; | ||||||||||||
| padding: 0 1rem 0 0.6rem; | ||||||||||||
| } | ||||||||||||
|
|
@@ -191,7 +190,7 @@ | |||||||||||
| } | ||||||||||||
|
|
||||||||||||
| .header-links > li > a { | ||||||||||||
| color: #fff; | ||||||||||||
| color: var(--color-neutral-80); | ||||||||||||
| margin-left: 0; | ||||||||||||
| display: block; | ||||||||||||
| width: var(--navbar-icon-size-rg); | ||||||||||||
|
|
@@ -339,6 +338,17 @@ background-color: var(--color-neutral-10); | |||||||||||
| margin-left: 0.4rem; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| .header-links > li > .app-header-btn.app-header-btn--theme { | ||||||||||||
| display: inline-flex; | ||||||||||||
| align-items: center; | ||||||||||||
| gap: 0.4rem; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| .header-links > li > .app-header-btn.app-header-btn--theme .icon { | ||||||||||||
| fill: var(--color-brand-primary); | ||||||||||||
| color: var(--color-brand-primary); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| .header-links > li > .app-header-btn.app-header-btn--secondary:hover, | ||||||||||||
| .header-links > li > .app-header-btn.app-header-btn--secondary:focus { | ||||||||||||
| background-color: rgba(var(--color-neutral-10-rgb), 0.1); | ||||||||||||
|
|
@@ -443,7 +453,7 @@ background-color: var(--color-neutral-10); | |||||||||||
|
|
||||||||||||
| transform: translate(-50%, -50%); | ||||||||||||
|
|
||||||||||||
| background: white; | ||||||||||||
| background: var(--color-neutral-10); | ||||||||||||
| box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62); | ||||||||||||
| -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62); | ||||||||||||
| -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62); | ||||||||||||
|
|
@@ -575,3 +585,8 @@ background-color: var(--color-neutral-10); | |||||||||||
| margin-left: 5px; | ||||||||||||
| cursor: pointer; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /* Dark mode header stays dark */ | ||||||||||||
| html[data-theme='dark'] .app-header { | ||||||||||||
| background: #0b1120; | ||||||||||||
| } | ||||||||||||
|
Comment on lines
+588
to
+592
|
||||||||||||
| /* Dark mode header stays dark */ | |
| html[data-theme='dark'] .app-header { | |
| background: #0b1120; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline anti-FOUC script assumes
localStorageaccess always succeeds. In some environments (e.g., privacy modes or restricted storage),localStorage.getItemcan throw and break the script. Wrap the localStorage read in a try/catch (and fall back toprefers-color-scheme) so a storage exception doesn’t prevent the theme attribute from being set.