-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_variables.scss
188 lines (167 loc) · 7.2 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
// 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: darken($baseColor, 5%);
$lightLinkHoverColor: lighten($lightLinkColor, 15%);
$lightPostMetaColor: $lightTextColor;
$lightTopMetaColor: lighten($black, 40%);
$lightBottomMetaColor: $lightTopMetaColor;
$lightNoticeBorderColor: $baseColor;
$lightNoticeBackgroundColor: lighten($baseColor, 45%);
$lightCodeBackgroundColor: lighten($baseColor, 45%);
$lightCodeSelectionBackgroundColor: lighten($baseColor, 33%);
$lightMarkBackgroundColor: lighten($baseColor, 55%);
$lightMarkColor: $black;
$lightThemeSwitcherColor: $lightLinkColor;
$lightMobileMenuBackgroundColor: $lightBackgroundColor;
$lightMobileMenuSeparatorColor: darken($white, 8%);
$lightScrollUpArrowBackgroundColor: lighten($lightLinkColor, 10%);
$lightScrollUpArrowHoverBackgroundColor: darken(
$lightScrollUpArrowBackgroundColor,
7%
);
$lightPaginationColor: $lightTextColor;
$lightPaginationFocusBackgroundColor: $lightNoticeBackgroundColor;
$lightPaginationInactiveColor: lighten($lightPostMetaColor, 25%);
$lightPaginationJumpButtonBackgroundColor: $lightPaginationInactiveColor;
$lightFooterSeparatorColor: lighten($black, 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};
--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: darken($darkLinkColor, 10%);
$darkPostMetaColor: $darkTextColor;
$darkTopMetaColor: darken($darkTextColor, 10%);
$darkBottomMetaColor: $darkTopMetaColor;
$darkNoticeBorderColor: darken($baseColor, 2%);
$darkNoticeBackgroundColor: lighten($black, 3%);
$darkCodeBackgroundColor: lighten($black, 3%);
$darkCodeSelectionBackgroundColor: lighten($black, 16%);
$darkMarkBackgroundColor: darken($darkLinkHoverColor, 25%);
$darkMarkColor: lighten($darkTextColor, 0%);
$darkThemeSwitcherColor: $darkLinkColor;
$darkMobileMenuBackgroundColor: $darkBackgroundColor;
$darkMobileMenuSeparatorColor: lighten($black, 5%);
$darkScrollUpArrowBackgroundColor: darken($darkLinkColor, 10%);
$darkScrollUpArrowHoverBackgroundColor: darken(
$darkScrollUpArrowBackgroundColor,
7%
);
$darkPaginationPageNumberInputTextColor: $darkTextColor;
$darkPaginationColor: lighten($black, 55%);
$darkPaginationFocusBackgroundColor: $darkNoticeBackgroundColor;
$darkPaginationInactiveColor: darken($darkPostMetaColor, 18%);
$darkPaginationJumpButtonBackgroundColor: $darkPaginationInactiveColor;
$darkFooterSeparatorColor: lighten($black, 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};
--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;
}
}