This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dark.css
77 lines (64 loc) · 2.18 KB
/
dark.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
this was kindly stolen from here: https://dev.to/louislow/comment/1414k
although i'm uncertain whether or not this is the origin of this code
as i've seen it plenty of times before
*/
html {
filter: invert(1) hue-rotate(180deg);
}
img:not(.featured *), picture, video, iframe, .featured, .bg, .tag, .container > .newsletter, .footer > .copy,
.img.glightbox,
#glightbox-body,
#app > div.search {
filter: invert(1) hue-rotate(180deg);
}
/*
this looks (and is) rather hacky but it just cheaply disables the filter on
any fullscreen picture
*/
#glightbox-slider * img, image, video, picture, iframe {
filter: none;
}
/*
this fixes a bunch of stuff only broken on firefox,
the background-color is necessary because firefox does not apply the invert filter on
white backgrounds and also hasn't yet implemented backdrop-filter
the other things prevent that the filter are used when the full screen view of an element is active,
this causes position:fixed to work differently and moves the fullscreen view in a strange area
in addition, the color overlay is permanently set to black to avoid eye-bleach when the animation
plays while dark mode isn't yet applied again
similar issue with the search bar, the workaround below isn't beautiful but it works well enough
*/
@-moz-document url-prefix() {
html {
background-color: black;
}
html.glightbox-open {
filter: none;
}
#glightbox-body .goverlay {
background: white;
opacity: 100% !important;
}
:matches(html.glightbox-open) img:not(.featured *), picture, video, iframe, .featured, .bg, .tag, .container > .newsletter, .footer > .copy {
filter: none;
}
#glightbox-body * button.gbtn {
filter: invert(1) hue-rotate(180deg);
}
#glightbox-slider * img, image, video, picture, iframe {
filter: invert(1) hue-rotate(180deg) !important;
}
#glightbox-slider * div.gslide-media {
box-shadow: none;
}
#app > div.search {
display: none;
position: sticky;
width: 100vw;
height: 100vh;
}
#app > div.search.active {
display: grid !important;
}
}