Skip to content

Commit 80ecf03

Browse files
Copilotulysses4ever
andcommitted
Keep button graphics visible in dark mode using filter instead of hiding background
Co-authored-by: ulysses4ever <[email protected]>
1 parent 9cdc84c commit 80ecf03

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

docs/assets/css/dark-mode.css

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ body.dark-mode {
137137
body.dark-mode #newsplash {
138138
color: #e0e0e0;
139139
background-color: #1a1a1a !important;
140-
background-image: none !important;
140+
/* Dim the background image instead of hiding it */
141+
filter: brightness(0.4) contrast(1.2);
142+
}
143+
144+
/* Prevent filter from affecting child elements */
145+
body.dark-mode #newsplash > div {
146+
filter: brightness(2.5) contrast(0.83);
141147
}
142148

143149
body.dark-mode .newsplash a.nostarchlink {
@@ -148,29 +154,12 @@ body.dark-mode .newsplash a.nostarchlink:hover {
148154
color: #ff6666;
149155
}
150156

151-
/* Make index page buttons visible in dark mode */
157+
/* Make index page buttons slightly more visible in dark mode without hiding graphics */
152158
body.dark-mode #faq-button,
153159
body.dark-mode #book-button,
154160
body.dark-mode #read-button {
155-
text-indent: 0;
156-
background-color: rgba(102, 179, 255, 0.15);
157-
border: 2px solid #66b3ff;
158-
border-radius: 8px;
159-
color: #66b3ff;
160-
font-weight: bold;
161-
display: flex;
162-
align-items: center;
163-
justify-content: center;
164-
text-align: center;
165-
transition: all 0.3s ease;
166-
}
167-
168-
body.dark-mode #faq-button:hover,
169-
body.dark-mode #book-button:hover,
170-
body.dark-mode #read-button:hover {
171-
background-color: rgba(102, 179, 255, 0.25);
172-
color: #ff6666;
173-
border-color: #ff6666;
161+
/* Keep the buttons as clickable areas over the dimmed graphics */
162+
opacity: 1;
174163
}
175164

176165
/* Handle image backgrounds in dark mode */

0 commit comments

Comments
 (0)