|
6 | 6 | * MIT Licensed |
7 | 7 | */ |
8 | 8 |
|
9 | | -@mixin darkScheme() { |
| 9 | +@mixin dark-scheme { |
10 | 10 | /* framework */ |
11 | 11 | --main-wrapper-bg: rgb(27, 27, 30); |
12 | 12 | --topbar-wrapper-bg: rgb(39, 40, 43); |
|
24 | 24 | /* common color */ |
25 | 25 | --text-color: rgb(175, 176, 177); |
26 | 26 | --text-muted-color: rgb(107, 116, 124); |
27 | | - --link-color: #3db5c2; |
28 | | - --link-underline-color: #3db5c2; |
| 27 | + --link-color: rgb(138, 180, 248); |
| 28 | + --link-underline-color: rgb(99, 131, 182); |
29 | 29 | --main-border: rgb(63, 65, 68); |
30 | 30 | --button-bg: rgb(39, 40, 33); |
31 | 31 | --blockquote-border: rgb(66, 66, 66); |
|
57 | 57 | --timeline-node-bg: rgb(150, 152, 156); |
58 | 58 | } |
59 | 59 |
|
60 | | - |
61 | 60 | /* Light scheme prefered (= dark scheme not prefered) |
62 | | - * -> dark scheme triggered with <body class="color-scheme-dark"> |
| 61 | + * -> dark scheme triggered with <html class="dark-mode"> |
63 | 62 | */ |
64 | | -body.color-scheme-dark{ |
| 63 | +html.dark-mode { |
65 | 64 | /* Dark scheme */ |
66 | | - @include darkScheme(); |
| 65 | + @include dark-scheme; |
| 66 | + |
67 | 67 | // Hide element in dark color scheme |
68 | 68 | // (visible in light scheme) |
69 | | - .color-scheme-dark-hidden { |
| 69 | + .dark-mode-hidden { |
70 | 70 | display: none; |
71 | 71 | } |
72 | | - .color-scheme-light-hidden { |
| 72 | + |
| 73 | + .light-mode-hidden { |
73 | 74 | display: initial; |
74 | 75 | } |
75 | 76 | } |
76 | | -body:not(.color-scheme-dark) { |
77 | | - /* Light scheme */ |
| 77 | + |
| 78 | +html:not(.dark-mode) { |
78 | 79 | // Hide element in dark color scheme |
79 | 80 | // (visible in light scheme) |
80 | | - .color-scheme-light-hidden { |
| 81 | + .light-mode-hidden { |
81 | 82 | display: none; |
82 | 83 | } |
83 | | - .color-scheme-dark-hidden { |
| 84 | + |
| 85 | + .dark-mode-hidden { |
84 | 86 | display: initial; |
85 | 87 | } |
86 | 88 | } |
87 | 89 |
|
| 90 | + |
88 | 91 | @media (prefers-color-scheme: dark) { |
89 | 92 | /* Dark scheme prefered |
90 | | - * -> light scheme triggered with <body class="color-scheme-light"> |
| 93 | + * -> light scheme triggered with <html class="light-mode"> |
91 | 94 | */ |
92 | | - body:not(.color-scheme-light) { |
| 95 | + html:not(.light-mode) { |
93 | 96 | /* Dark scheme */ |
94 | | - @include darkScheme(); |
| 97 | + @include dark-scheme; |
95 | 98 | // Hide element in dark color scheme |
96 | 99 | // (visible in light scheme) |
97 | | - .color-scheme-dark-hidden { |
| 100 | + .dark-mode-hidden { |
98 | 101 | display: none; |
99 | 102 | } |
100 | | - .color-scheme-light-hidden { |
| 103 | + |
| 104 | + .light-mode-hidden { |
101 | 105 | display: initial; |
102 | 106 | } |
103 | 107 | } |
104 | | - body.color-scheme-light { |
| 108 | + |
| 109 | + html.light-mode { |
105 | 110 | /* Light scheme */ |
106 | 111 | // Hide element in dark color scheme |
107 | 112 | // (visible in light scheme) |
108 | | - .color-scheme-light-hidden { |
| 113 | + .light-mode-hidden { |
109 | 114 | display: none; |
110 | 115 | } |
111 | | - .color-scheme-dark-hidden { |
| 116 | + .dark-mode-hidden { |
112 | 117 | display: initial; |
113 | 118 | } |
114 | 119 | } |
| 120 | + |
115 | 121 | } |
0 commit comments