Skip to content

Commit

Permalink
Add color-scheme: dark to avoid problems with browser's "Force dark…
Browse files Browse the repository at this point in the history
… mode" option

Some browsers have an option to force a "fake" dark mode. This darkens most elements and uses light text, but the forced mode fails for some properties on a few elements. Using the CSS `color-scheme: dark` property disables the `force-dark-mode` browser property and applies only the theme CSS.
  • Loading branch information
rdwebdesign authored Apr 8, 2023
2 parents 8f95ec7 + cd887a2 commit 7c2ebef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions style/themes/default-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
--datatable-bgcolor: rgba(64, 76, 88, 0.8);
}

/* fix #2554: browser not detecting dark mode */
html {
color-scheme: dark;
}

body {
background-color: #353c42;
color: #bec5cb;
Expand Down
2 changes: 2 additions & 0 deletions style/themes/default-darker.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ _______|_______/__/ ____ \__\__|___\__\__|___\__\____
/* User-Agent Style */
html {
background-color: #181a1b !important;
/* fix #2554: browser not detecting dark mode */
color-scheme: dark;
}
html,
body,
Expand Down
5 changes: 5 additions & 0 deletions style/themes/high-contrast-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
transition: none !important;
}

/* fix #2554: browser not detecting dark mode */
html {
color-scheme: dark;
}

body {
font-size: 15px;
color: var(--main-text-color);
Expand Down
2 changes: 2 additions & 0 deletions style/themes/lcars.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/*** General ***/
html {
font-size: 17px;
/* fix #2554: browser not detecting dark mode */
color-scheme: dark;
}

body {
Expand Down

0 comments on commit 7c2ebef

Please sign in to comment.