-
Notifications
You must be signed in to change notification settings - Fork 20
/
_variables.scss
219 lines (197 loc) · 7.83 KB
/
_variables.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
@use 'sass:color';
// Base values
$baseSize: 16px;
// Base colors
$baseHue: 210;
$baseColor: hsl($baseHue, 80%, 50%);
$white: hsl($baseHue, 80%, 98%);
$black: hsl($baseHue, 5%, 10%);
// Fonts
$baseSerifFontStack: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
$serifFontFamily: 'Merriweather', $baseSerifFontStack;
$serifBoldFontFamily: 'Merriweather Bold', $baseSerifFontStack;
$serifItalicFontFamily: 'Merriweather Italic', $baseSerifFontStack;
$serifBoldItalicFontFamily: 'Merriweather Bold Italic', $baseSerifFontStack;
$sansSerifFontFamily:
PT Sans,
ui-sans-serif,
system-ui,
-apple-system,
BlinkMacSystemFont,
Segoe UI,
Roboto,
SF Pro,
Helvetica,
Arial,
Noto Sans,
sans-serif;
$arialFamily: Arial, Helvetica, sans-serif;
$emojiFontFamily:
Apple Color Emoji,
Segoe UI Emoji,
Segoe UI Symbol,
Noto Color Emoji;
// Spacings
$spacing: 1rem;
$mainBreakpoint: (48 * $baseSize) - 1px;
$mediumBreakpoint: 36rem;
$menuBreakpoint: $mainBreakpoint + (6 * $baseSize);
$footerBreakpoint: 32rem;
// Timings
$defaultTransitionTime: 0.1s;
$longTransitionTime: 0.2s;
// Common CSS variables
:root {
--base-font-size: #{$baseSize};
--spacing: #{$spacing};
--text-font-family: #{$serifFontFamily};
--serif-bold-font-family: #{$serifBoldFontFamily};
--serif-italic-font-family: #{$serifItalicFontFamily};
--serif-bold-italic-font-family: #{$serifBoldItalicFontFamily};
--arial-font-family: #{$arialFamily};
--emoji-font-family: #{$emojiFontFamily};
--heading-font-family: #{$sansSerifFontFamily};
--read-more-hover-color: #{$white};
--base-color: #{$baseColor};
--default-transition-time: #{$defaultTransitionTime};
--long-transition-time: #{$longTransitionTime};
}
// Light mode colors
$lightBackgroundColor: $white;
$lightTextColor: $black;
$lightLinkColor: color.adjust($baseColor, $lightness: -5%);
$lightLinkHoverColor: color.adjust($lightLinkColor, $lightness: 15%);
$lightPostMetaColor: $lightTextColor;
$lightTopMetaColor: color.adjust($black, $lightness: 40%);
$lightBottomMetaColor: $lightTopMetaColor;
$lightNoticeBorderColor: $baseColor;
$lightNoticeBackgroundColor: color.adjust($baseColor, $lightness: 45%);
$lightCodeBackgroundColor: color.adjust($baseColor, $lightness: 45%);
$lightCodeSelectionBackgroundColor: color.adjust($baseColor, $lightness: 33%);
$lightMarkBackgroundColor: color.adjust($baseColor, $lightness: 55%);
$lightMarkColor: $black;
$lightAsideColor: $lightLinkColor;
$lightThemeSwitcherColor: $lightLinkColor;
$lightMobileMenuBackgroundColor: $lightBackgroundColor;
$lightMobileMenuSeparatorColor: color.adjust($white, $lightness: -8%);
$lightScrollUpArrowBackgroundColor: color.adjust(
$lightLinkColor,
$lightness: 10%
);
$lightScrollUpArrowHoverBackgroundColor: color.adjust(
$lightScrollUpArrowBackgroundColor,
$lightness: 7%
);
$lightPaginationColor: $lightTextColor;
$lightPaginationFocusBackgroundColor: $lightNoticeBackgroundColor;
$lightPaginationInactiveColor: color.adjust(
$lightPostMetaColor,
$lightness: 25%
);
$lightPaginationJumpButtonBackgroundColor: $lightPaginationInactiveColor;
$lightFooterSeparatorColor: color.adjust($black, $lightness: 76%);
@mixin lightModeColors {
--background-color: #{$lightBackgroundColor};
--text-color: #{$lightTextColor};
--link-color: #{$lightLinkColor};
--link-hover-color: #{$lightLinkHoverColor};
--post-meta-color: #{$lightPostMetaColor};
--top-meta-color: #{$lightTopMetaColor};
--bottom-meta-color: #{$lightBottomMetaColor};
--notice-border-color: #{$lightNoticeBorderColor};
--notice-background-color: #{$lightNoticeBackgroundColor};
--code-background-color: #{$lightCodeBackgroundColor};
--code-selection-background-color: #{$lightCodeSelectionBackgroundColor};
--mark-background-color: #{$lightMarkBackgroundColor};
--mark-color: #{$lightMarkColor};
--aside-color: #{$lightAsideColor};
--theme-switcher-color: #{$lightThemeSwitcherColor};
--mobile-menu-background-color: #{$lightMobileMenuBackgroundColor};
--mobile-menu-separator-color: #{$lightMobileMenuSeparatorColor};
--scroll-up-arrow-background-color: #{$lightScrollUpArrowBackgroundColor};
--scroll-up-arrow-hover-background-color: #{$lightScrollUpArrowHoverBackgroundColor};
--pagination-page-number-input-text-color: #{$lightTextColor};
--pagination-page-number-input-background-color: #{$lightBackgroundColor};
--pagination-color: #{$lightPaginationColor};
--pagination-focus-background-color: #{$lightPaginationFocusBackgroundColor};
--pagination-inactive-color: #{$lightPaginationInactiveColor};
--pagination-jump-button-background-color: #{$lightPaginationJumpButtonBackgroundColor};
--footer-separator-color: #{$lightFooterSeparatorColor};
}
:root,
html:not(.dark) {
@include lightModeColors;
}
// Dark mode colors
$darkBackgroundColor: $black;
$darkTextColor: hsl($baseHue, 5%, 70%);
$darkLinkColor: hsl($baseHue, 60%, 75%);
$darkLinkHoverColor: color.adjust($darkLinkColor, $lightness: -10%);
$darkPostMetaColor: $darkTextColor;
$darkTopMetaColor: color.adjust($darkTextColor, $lightness: -10%);
$darkBottomMetaColor: $darkTopMetaColor;
$darkNoticeBorderColor: color.adjust($baseColor, $lightness: -2%);
$darkNoticeBackgroundColor: color.adjust($black, $lightness: -3%);
$darkCodeBackgroundColor: color.adjust($black, $lightness: -3%);
$darkCodeSelectionBackgroundColor: color.adjust($black, $lightness: -16%);
$darkMarkBackgroundColor: color.adjust($darkLinkHoverColor, $lightness: -25%);
$darkMarkColor: $darkTextColor;
$darkAsideColor: $darkLinkColor;
$darkThemeSwitcherColor: $darkLinkColor;
$darkMobileMenuBackgroundColor: $darkBackgroundColor;
$darkMobileMenuSeparatorColor: color.adjust($black, $lightness: -5%);
$darkScrollUpArrowBackgroundColor: color.adjust(
$darkLinkColor,
$lightness: -10%
);
$darkScrollUpArrowHoverBackgroundColor: color.adjust(
$darkScrollUpArrowBackgroundColor,
$lightness: -7%
);
$darkPaginationPageNumberInputTextColor: $darkTextColor;
$darkPaginationColor: color.adjust($black, $lightness: -55%);
$darkPaginationFocusBackgroundColor: $darkNoticeBackgroundColor;
$darkPaginationInactiveColor: color.adjust(
$darkPostMetaColor,
$lightness: -18%
);
$darkPaginationJumpButtonBackgroundColor: $darkPaginationInactiveColor;
$darkFooterSeparatorColor: color.adjust($black, $lightness: 10%);
@mixin darkModeColors {
--background-color: #{$darkBackgroundColor};
--text-color: #{$darkTextColor};
--link-color: #{$darkLinkColor};
--link-hover-color: #{$darkLinkHoverColor};
--post-meta-color: #{$darkPostMetaColor};
--top-meta-color: #{$darkTopMetaColor};
--bottom-meta-color: #{$darkBottomMetaColor};
--notice-border-color: #{$darkNoticeBorderColor};
--notice-background-color: #{$darkNoticeBackgroundColor};
--code-background-color: #{$darkCodeBackgroundColor};
--code-selection-background-color: #{$darkCodeSelectionBackgroundColor};
--mark-background-color: #{$darkMarkBackgroundColor};
--mark-color: #{$darkMarkColor};
--aside-color: #{$darkAsideColor};
--theme-switcher-color: #{$darkThemeSwitcherColor};
--mobile-menu-background-color: #{$darkMobileMenuBackgroundColor};
--mobile-menu-separator-color: #{$darkMobileMenuSeparatorColor};
--scroll-up-arrow-background-color: #{$darkScrollUpArrowBackgroundColor};
--scroll-up-arrow-hover-background-color: #{$darkScrollUpArrowHoverBackgroundColor};
--pagination-color: #{$darkPaginationColor};
--pagination-page-number-input-text-color: #{$darkTextColor};
--pagination-page-number-input-background-color: #{$darkBackgroundColor};
--pagination-focus-background-color: #{$darkPaginationFocusBackgroundColor};
--pagination-inactive-color: #{$darkPaginationInactiveColor};
--pagination-jump-button-background-color: #{$darkPaginationJumpButtonBackgroundColor};
--footer-separator-color: #{$darkFooterSeparatorColor};
}
html.dark {
@include darkModeColors;
}
@media (prefers-color-scheme: dark) {
:root,
html:not(.light),
html.dark {
@include darkModeColors;
}
}