Skip to content

Commit 948c2ef

Browse files
Copilotulysses4ever
andcommitted
Fix text readability and remove black margin using pseudo-element overlay
Co-authored-by: ulysses4ever <[email protected]>
1 parent 80ecf03 commit 948c2ef

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

docs/assets/css/dark-mode.css

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,26 @@ body.dark-mode {
137137
body.dark-mode #newsplash {
138138
color: #e0e0e0;
139139
background-color: #1a1a1a !important;
140-
/* Dim the background image instead of hiding it */
141-
filter: brightness(0.4) contrast(1.2);
140+
position: relative;
142141
}
143142

144-
/* Prevent filter from affecting child elements */
143+
/* Add a dark overlay using pseudo-element to dim background while keeping text readable */
144+
body.dark-mode #newsplash::before {
145+
content: "";
146+
position: absolute;
147+
top: 0;
148+
left: 0;
149+
right: 0;
150+
bottom: 0;
151+
background-color: rgba(26, 26, 26, 0.65);
152+
pointer-events: none;
153+
z-index: 0;
154+
}
155+
156+
/* Ensure content is above the overlay */
145157
body.dark-mode #newsplash > div {
146-
filter: brightness(2.5) contrast(0.83);
158+
position: relative;
159+
z-index: 1;
147160
}
148161

149162
body.dark-mode .newsplash a.nostarchlink {

0 commit comments

Comments
 (0)