Skip to content

Commit

Permalink
Merge pull request #2134 from GiorgioReale/master
Browse files Browse the repository at this point in the history
Enhancing themes with `color-scheme: light | dark;` implementation in CSS
  • Loading branch information
ehuss authored Jul 30, 2023
2 parents 4614a36 + fcfde08 commit ab2cb71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/theme/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:root {
/* Browser default font-size is 16px, this way 1 rem = 10px */
font-size: 62.5%;
color-scheme: var(--color-scheme);
}

html {
Expand Down
10 changes: 10 additions & 0 deletions src/theme/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
--searchresults-border-color: #888;
--searchresults-li-bg: #252932;
--search-mark-bg: #e3b171;

--color-scheme: dark;
}

.coal {
Expand Down Expand Up @@ -90,6 +92,8 @@
--searchresults-border-color: #98a3ad;
--searchresults-li-bg: #2b2b2f;
--search-mark-bg: #355c7d;

--color-scheme: dark;
}

.light {
Expand Down Expand Up @@ -130,6 +134,8 @@
--searchresults-border-color: #888;
--searchresults-li-bg: #e4f2fe;
--search-mark-bg: #a2cff5;

--color-scheme: light;
}

.navy {
Expand Down Expand Up @@ -170,6 +176,8 @@
--searchresults-border-color: #5c5c68;
--searchresults-li-bg: #242430;
--search-mark-bg: #a2cff5;

--color-scheme: dark;
}

.rust {
Expand Down Expand Up @@ -210,6 +218,8 @@
--searchresults-border-color: #888;
--searchresults-li-bg: #dec2a2;
--search-mark-bg: #e69f67;

--color-scheme: light;
}

@media (prefers-color-scheme: dark) {
Expand Down

0 comments on commit ab2cb71

Please sign in to comment.