Use data-theme attribute for theme switching and set color-scheme (#1808)

- Update theme toggle and initialization scripts to set data-theme attribute
- Replace CSS selectors using .dark class with [data-theme="dark"] and 
  [data-theme="light"] attribute selectors
- Set CSS color-scheme variable alongside theme colors for better native 
  control appearance
- Removes redundant styles

---------

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
This commit is contained in:
Huang, Zhaoquan
2025-10-26 21:21:50 +08:00
committed by GitHub
parent c98a924842
commit b63c195a10
7 changed files with 29 additions and 24 deletions

View File

@@ -41,12 +41,11 @@ button#theme-toggle {
margin: auto 4px;
}
body.dark #moon {
vertical-align: middle;
[data-theme="dark"] #moon {
display: none;
}
body:not(.dark) #sun {
[data-theme="light"] #sun {
display: none;
}