Skip to content

Commit 5549ebc

Browse files
committed
add dark mode
1 parent 89fce1e commit 5549ebc

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

themes/rusted/static/css/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ a {
9292
text-decoration: none;
9393

9494
&:visited {
95-
color: darken($brand-color, 15%);
95+
color: $brand-color-visited;
9696
}
9797

9898
&:hover {

themes/rusted/static/css/_layout.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
letter-spacing: -1px;
1818
margin-bottom: 0;
1919

20-
&,
20+
color: $text-color;
2121
&:visited {
22-
color: $grey-colour-dark;
22+
color: $text-color;
2323
}
2424
}
2525

themes/rusted/static/css/main.scss

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,49 @@
33
// Bootstrap variables
44
$screen-xs-max: 768px !default;
55

6-
// Our variables
76
$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
87
$base-font-size: 16px;
98
$small-font-size: $base-font-size * 0.875;
109
$base-line-height: 1.5;
1110

1211
$spacing-unit: 30px;
1312

14-
$text-color: #444;
15-
$background-color: #fdfdfd;
16-
$brand-color: #2a7ae2;
17-
18-
$grey-colour: #828282;
13+
// Our variables
14+
$text-color: var(--text-color);
15+
$background-color: var(--background-color);
16+
$brand-color: var(--brand-color);
17+
$brand-color-visited: var(--brand-color-visited);
18+
$grey-colour: #828282;
1919
$grey-colour-light: lighten($grey-colour, 40%);
20-
$grey-colour-dark: darken($grey-colour, 25%);
20+
$grey-colour-dark: darken($grey-colour, 25%);
21+
22+
// Light theme colors
23+
$text-color-lt: #444;
24+
$background-color-lt: #fdfdfd;
25+
$brand-color-lt: #2a7ae2;
26+
$brand-color-visited-lt: #1756a9;
27+
28+
// Dark theme colors
29+
$text-color-dt: #f0f0f0;
30+
$background-color-dt: #353535;
31+
$brand-color-dt: #d2991d;
32+
$brand-color-visited-dt: #9a7015;
33+
34+
:root {
35+
--text-color: #{$text-color-lt};
36+
--background-color: #{$background-color-lt};
37+
--brand-color: #{$brand-color-lt};
38+
--brand-color-visited: #{$brand-color-visited-lt};
39+
}
40+
41+
@media(prefers-color-scheme: dark) {
42+
:root {
43+
--text-color: #{$text-color-dt};
44+
--background-color: #{$background-color-dt};
45+
--brand-color: #{$brand-color-dt};
46+
--brand-color-visited: #{$brand-color-visited-dt};
47+
}
48+
}
2149

2250
$on-palm: 600px;
2351
$on-laptop: 800px;

0 commit comments

Comments
 (0)