Skip to content

Commit 1a5a9e2

Browse files
authored
Support dark themes in Firefox (#7)
1 parent 73db042 commit 1a5a9e2

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

webext-base.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
@import 'chrome://global/skin/in-content/common.css'; /* Firefox-only */
88

99
:root {
10-
--body-margin-h: 8px;
10+
--background-color-for-chrome: #292a2d;
1111
max-width: 700px;
1212
margin: auto;
1313
}
1414

1515
body {
16+
--body-margin-h: 8px;
1617
margin-left: var(--body-margin-h);
1718
margin-right: var(--body-margin-h);
1819
}
@@ -77,12 +78,14 @@ textarea {
7778
}
7879

7980
@-moz-document url-prefix('') {
80-
:root {
81-
--body-margin-h: 6px; /* Must be a variable so <hr>’s margin is changed too */
82-
background-color: #fff;
83-
}
84-
81+
:root, /* Visible on a options_page */
8582
body {
83+
--body-margin-h: 6px; /* Must be a variable so <hr>’s margin is changed too */ /* Visible on a options_page and options_ui */
84+
color: var(--in-content-page-color);
85+
86+
/* Also supports dark themes in Firefox */
87+
/* !important is to override the dark-mode setting for Chrome below */
88+
background-color: var(--in-content-box-background) !important;
8689
min-height: 250px; /* Without this there’s a white space at the bottom in dark mode */
8790
}
8891

@@ -98,7 +101,7 @@ textarea {
98101

99102
@media (prefers-color-scheme: dark) {
100103
:root {
101-
background-color: var(--in-content-box-background, #292a2d);
104+
background-color: var(--background-color-for-chrome);
102105
}
103106

104107
body,

0 commit comments

Comments
 (0)