forked from withastro/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.css
184 lines (167 loc) · 6.92 KB
/
theme.css
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
/*
Define common sizes and spacings
*/
:root {
--theme-navbar-height: 6rem;
--theme-mobile-toc-height: 4rem;
--theme-left-sidebar-width: 20rem;
--theme-right-sidebar-width: 18rem;
/*
Minimum visual horizontal spacing from the edges of the viewport,
and between vertically arranged elements
*/
--min-spacing-inline: 1rem;
/* Vertical spacing around the article content and the right sidebar */
--doc-padding-block: 0.5rem;
--max-width: 100%;
--cur-viewport-height: 100vh;
}
@media (min-width: 50em) {
:root {
--min-spacing-inline: 1.5rem;
--doc-padding-block: 1rem;
--max-width: 46em;
}
}
@media (min-width: 72em) {
:root {
--doc-padding-block: 2rem;
}
}
/* Use dynamic viewport height if the unit is supported by the browser */
@supports (height: 100dvh) {
:root {
--cur-viewport-height: 100dvh;
}
}
/*
Define common fonts and colors
*/
:root {
--font-fallback: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
--font-body: system-ui, var(--font-fallback);
--font-mono: 'IBM Plex Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono',
'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;
/*
Variables with --color-base prefix define
the hue, and saturation values to be used for
hsla colors.
Example:
--color-base-{color}: {hue}, {saturation};
*/
--color-base-white: 0, 0%;
--color-base-black: 240, 100%;
--color-base-gray: 250, 14%;
--color-base-blue: 212, 100%;
--color-base-blue-dark: 212, 72%;
--color-base-teal: 180, 80%;
--color-base-green: 158, 79%;
--color-base-orange: 22, 100%;
--color-base-purple: 269, 79%;
--color-base-red: 351, 100%;
--color-base-yellow: 41, 100%;
/*
Color palettes are made using --color-base
variables, along with a lightness value to
define different variants.
*/
--color-gray-5: var(--color-base-gray), 5%;
--color-gray-10: var(--color-base-gray), 10%;
--color-gray-20: var(--color-base-gray), 20%;
--color-gray-30: var(--color-base-gray), 30%;
--color-gray-40: var(--color-base-gray), 40%;
--color-gray-50: var(--color-base-gray), 50%;
--color-gray-60: var(--color-base-gray), 60%;
--color-gray-70: var(--color-base-gray), 70%;
--color-gray-80: var(--color-base-gray), 80%;
--color-gray-90: var(--color-base-gray), 90%;
--color-gray-95: var(--color-base-gray), 95%;
--color-blue: var(--color-base-blue), 61%;
--color-blue-dark: var(--color-base-blue-dark), 39%;
--color-green: var(--color-base-green), 42%;
--color-orange: var(--color-base-orange), 50%;
--color-purple: var(--color-base-purple), 54%;
--color-red: var(--color-base-red), 54%;
--color-yellow: var(--color-base-yellow), 59%;
}
:root {
color-scheme: light;
--theme-accent: hsla(var(--color-orange), 1);
--theme-accent-secondary: hsl(324, 75%, 38%);
--theme-dim: hsla(var(--color-gray-70), 1);
--theme-dim-light: hsla(var(--color-gray-80), 1);
--theme-dim-lighter: hsla(var(--color-gray-90), 1);
--theme-accent-opacity: 0.1;
--theme-divider: hsla(var(--color-purple), 0.1);
--theme-shade-subtle: hsla(var(--color-purple), 0.3);
--theme-text: hsla(var(--color-gray-10), 1);
--theme-text-light: hsla(var(--color-gray-30), 1);
--theme-text-lighter: hsla(var(--color-gray-40), 1);
--theme-bg: hsl(273, 37%, 93%);
--theme-bg-gradient-top: var(--theme-bg);
--theme-bg-gradient-bottom: #fdfeff;
--theme-bg-hover: hsla(var(--color-purple), 0.075);
--theme-bg-offset: hsla(var(--color-purple), 0.1);
--theme-bg-accent: hsla(var(--color-purple), var(--theme-accent-opacity));
--theme-code-inline-bg: hsla(var(--color-purple), .1);
--theme-code-inline-text: var(--theme-text);
--theme-code-bg: hsla(257, 31%, 22%, 1);
--theme-code-text: hsla(var(--color-gray-95), 1);
--theme-navbar-bg: var(--theme-bg);
--theme-selection-color: hsla(var(--color-purple), 1);
--theme-selection-bg: hsla(var(--color-purple), var(--theme-accent-opacity));
--theme-bg-gradient: linear-gradient(180deg, var(--theme-bg-gradient-top), var(--theme-bg-gradient-top) calc(var(--theme-navbar-height) + var(--theme-mobile-toc-height)), var(--theme-bg-gradient-bottom));
--theme-glow-highlight: transparent;
--theme-glow-diffuse: hsla(var(--color-base-purple), 65%, 0.5);
--theme-glow-blur: 10px;
}
:root.theme-dark {
color-scheme: dark;
/* We lighten-up the orange in dark mode, to help with link contrast. */
--color-orange: var(--color-base-orange), 60%;
--theme-accent-opacity: 0.4;
--theme-accent: hsla(var(--color-orange), 1);
--theme-accent-secondary: hsla(var(--color-orange), 1);
--theme-text-accent: hsla(var(--color-orange), 1);
--theme-dim: hsla(var(--color-gray-90), 0.3);
--theme-dim-light: hsla(var(--color-gray-90), 0.2);
--theme-dim-lighter: hsla(var(--color-gray-90), 0.1);
--theme-divider: hsla(var(--color-gray-95), 0.1);
--theme-shade-subtle: hsla(var(--color-gray-95), 0.4);
--theme-text: hsla(var(--color-gray-90), 1);
--theme-text-light: hsla(var(--color-gray-80), 1);
--theme-text-lighter: hsla(var(--color-gray-70), 1);
--theme-bg: hsl(256, 27%, 19%);
--theme-bg-gradient-top: var(--theme-bg);
--theme-bg-gradient-bottom: hsl(251, 29%, 11%);
--theme-bg-hover: hsla(var(--color-purple), 0.2);
--theme-bg-offset: #0008;
--theme-code-inline-bg: #FFFFFF16;
--theme-code-inline-text: var(--theme-text-light);
--theme-code-bg: #0008;
--theme-code-text: hsla(var(--color-base-white), 100%, 1);
--theme-navbar-bg: var(--theme-bg);
--theme-selection-color: hsla(var(--color-base-white), 100%, 1);
--theme-selection-bg: hsla(var(--color-purple), var(--theme-accent-opacity));
--theme-glow-highlight: hsla(var(--color-base-purple), 50%, 1);
/* DocSearch [Algolia] */
--docsearch-primary-color: var(--theme-accent);
--docsearch-modal-background: var(--theme-bg-gradient-top);
--docsearch-searchbox-focus-background: var(--theme-bg-offset);
--docsearch-footer-background: var(--theme-bg-gradient-bottom);
--docsearch-text-color: var(--theme-text);
--docsearch-hit-background: var(--theme-bg-offset);
--docsearch-hit-shadow: none;
--docsearch-hit-color: var(--theme-text);
--docsearch-footer-shadow: inset 0 -1px 0 var(--theme-glow-highlight), inset 1px 0px 0 var(--theme-glow-highlight), inset -1px 0px 0 var(--theme-glow-highlight),
inset 0 calc(-1 * var(--theme-glow-blur)) var(--theme-glow-blur) calc(-1 * var(--theme-glow-blur)) var(--theme-glow-diffuse),
inset calc(-1 * var(--theme-glow-blur)) 0 var(--theme-glow-blur) calc(-1 * var(--theme-glow-blur)) var(--theme-glow-diffuse),
inset var(--theme-glow-blur) 0 var(--theme-glow-blur) calc(-1 * var(--theme-glow-blur)) var(--theme-glow-diffuse);
--docsearch-modal-shadow: 0 0 var(--theme-glow-blur) var(--theme-glow-diffuse), inset 0 0 0 1px var(--theme-glow-highlight),
inset 0 0 var(--theme-glow-blur) var(--theme-glow-diffuse);
--docsearch-container-background: hsla(var(--color-gray-10), 0.8);
}
::selection {
color: var(--theme-selection-color);
background-color: var(--theme-selection-bg);
}