Skip to content

Commit a25c74e

Browse files
authored
CD-115 - Add dark mode image inversion and exceptions for logos and favicons (#119)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
1 parent eaaac14 commit a25c74e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/css/custom.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@
2828
--ifm-color-primary-lightest: #4fddbf;
2929
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
3030
}
31+
32+
/* Invert all images on the page in dark mode */
33+
[data-theme='dark'] img {
34+
filter: invert(1) hue-rotate(180deg);
35+
}
36+
37+
/* This is a crucial addition to prevent issues with other images */
38+
/* The filter should not be applied to logos, favicons, or other assets */
39+
[data-theme='dark'] .navbar__logo img,
40+
[data-theme='dark'] .footer img {
41+
filter: none;
42+
}

0 commit comments

Comments
 (0)