-
Notifications
You must be signed in to change notification settings - Fork 3
/
_themes.scss
117 lines (96 loc) · 2.1 KB
/
_themes.scss
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@use 'abstracts/variables' as *;
@use "sass:map";
$themes: (
light: (background: $light-mode-background,
text: $light-mode-text,
text-emphasized: $light-mode-text-emphasized,
accent: $light-mode-accent,
link-underline: $light-mode-link-underline,
text-secondary: $light-mode-text-secondary,
highlight: $light-mode-highlight),
dark: (background: $dark-mode-background,
text: $dark-mode-text,
text-emphasized: $dark-mode-text-emphasized,
accent: $dark-mode-accent,
link-underline: $dark-mode-link-underline,
text-secondary: $dark-mode-text-secondary,
highlight: $dark-mode-highlight)
);
@mixin theme($theme) {
$colors: map.get($themes, $theme);
body {
background-color: map.get($colors, background);
color: map.get($colors, text);
}
header#masthead {
color: map.get($colors, text-emphasized);
nav {
border-color: map.get($colors, link-underline);
a {
&.active {
color: map.get($colors, accent);
}
}
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: map.get($colors, text-emphasized);
}
a {
color: map.get($colors, text-emphasized);
text-decoration-color: map.get($colors, link-underline);
transition-property: color, text-decoration-color;
transition-duration: 0.1s;
transition-timing-function: linear;
&:hover {
color: map.get($colors, accent);
text-decoration-color: map.get($colors, accent);
transition-property: color, text-decoration-color;
transition-duration: 0.1s;
transition-timing-function: linear;
}
}
ul.posts {
li {
time {
color: map.get($colors, text-secondary);
}
}
}
article {
header {
h1 {
a {
color: map.get($colors, accent);
}
}
time {
a {
color: map.get($colors, text-secondary);
}
}
}
}
footer {
border-color: map.get($colors, link-underline);
}
mark {
color: map.get($colors, text-emphasized);
color: inherit;
background: map.get($colors, highlight);
}
blockquote {
border-color: map.get($colors, link-underline);
}
}
@media (prefers-color-scheme: light) {
@include theme(light);
}
@media (prefers-color-scheme: dark) {
@include theme(dark);
}