Skip to content

Commit 944d7b8

Browse files
committed
dark mode: dim images
As per the guidance provided in https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/#aa-dark-mode-images wht this commit we tone down the images in dark mode, applying techniques to filter background images as described in https://css-tricks.com/apply-a-filter-to-a-background-image/. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6fb8785 commit 944d7b8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

assets/sass/dark-mode.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,38 @@
2222
$callout-color: #000000;
2323
$black-3: #cccccc;
2424
$main-bg: #000000;
25+
26+
body#{$class}::before {
27+
background-image: url("/images/bg/body.jpg");
28+
position: absolute;
29+
content: "";
30+
width: 100%;
31+
height: 200%;
32+
filter: brightness(.4) contrast(1.6);
33+
z-index: -1;
34+
}
35+
body#{$class} {
36+
background: transparent #000000;
37+
div#masthead {
38+
background: transparent;
39+
}
40+
div#masthead::before {
41+
content: "";
42+
width: 100%;
43+
height: 295px;
44+
background: url("/images/bg/isometric-grid.png") top right repeat;
45+
position: absolute;
46+
filter: brightness(.4) contrast(1.6);
47+
background-size: 35px 21px;
48+
z-index: -1;
49+
}
50+
div.monitor {
51+
filter: brightness(.7) contrast(1.2);
52+
}
53+
img {
54+
filter: brightness(.6) contrast(1.2);
55+
}
56+
}
2557
}
2658

2759
body#{$class} {

0 commit comments

Comments
 (0)