cabotia / cabotia.dev/ assets/main.scssa038d85870abfa5840f549c944fe88149c867b17
6.9 KB | 481 lines Raw
1
@import 'fonts.scss';
2

3
$font-size-2: 19px;
4

5
$landing-size-value: 2.2;
6
$landing-line-height: 1.4em;
7

8
$font-family-body: 'Castoro', serif;
9

10
@mixin light-theme {
11
	--color-bg: #fff;
12
	--color-text: #111;
13
	--color-accent: #b91c1c;
14
	--color-accent-hover: #df2929;
15
	--color-muted: #60606f;
16
	--color-faint: #afafb9;
17
	--color-rule: #ddd;
18
	--color-code-bg: #f4f4f2;
19
}
20

21
@mixin dark-theme {
22
	--color-bg: #2d3929;
23
	--color-text: #f5f2e9;
24
	--color-accent: #e38a3d;
25
	--color-accent-hover: #e9a56a;
26
	--color-muted: #b0b4a7;
27
	--color-faint: #9b9f93;
28
	--color-rule: #1a1d19;
29
	--color-code-bg: #1a1d19;
30
}
31

32
:root {
33
	@include light-theme;
34
	color-scheme: light;
35
}
36

37
@media (prefers-color-scheme: dark) {
38
	:root {
39
		@include dark-theme;
40
		color-scheme: dark;
41
	}
42
}
43

44
html[data-theme="light"] {
45
	@include light-theme;
46
	color-scheme: light;
47
}
48

49
html[data-theme="dark"] {
50
	@include dark-theme;
51
	color-scheme: dark;
52
}
53

54
* {
55
	box-sizing: border-box;
56
}
57

58
html {
59
	font-family: $font-family-body;
60
	font-weight: 500;
61
	font-size: $font-size-2;
62
	line-height: 1.4;
63
	background: var(--color-bg);
64
}
65

66
body {
67
	max-width: 900px;
68
	margin: 0 auto;
69
	padding: 2rem 1rem;
70
	color: var(--color-text);
71
}
72

73
a {
74
	color: var(--color-accent);
75
	&:hover {
76
		color: var(--color-accent-hover);
77
	}
78
}
79

80
header {
81
	display: flex;
82
	flex-wrap: nowrap;
83
	flex: 1 0 67%;
84
	align-items: center;
85

86
	.logo {
87
		flex-grow: 0;
88
		flex-shrink: 0;
89

90
		img {
91
			width: auto;
92
			height: 100px;
93
			max-width: 100%;
94
		}
95
	}
96

97
	nav {
98
		text-align: right;
99
		margin-left: auto;
100
		padding-left: 2.5vw;
101

102
		flex-grow: 1;
103
		flex-shrink: 1;
104

105
		a {
106
			font-family: sans-serif;
107
			font-weight: 700;
108

109
			&:not(:first-child) {
110
				margin-left: 2.5vw;
111
			}
112
		}
113
	}
114
}
115

116
.header-actions {
117
	display: flex;
118
	align-items: center;
119
	gap: 1rem;
120
	margin-left: 2.5vw;
121
}
122

123
.language-switcher {
124
	display: flex;
125
	align-items: center;
126
	gap: 0.4rem;
127
	font-family: sans-serif;
128
	font-size: 0.8rem;
129
	font-weight: 700;
130

131
	a {
132
		color: var(--color-muted);
133
		text-decoration: none;
134

135
		&:hover {
136
			color: var(--color-accent);
137
		}
138
	}
139

140
	.is-current {
141
		color: var(--color-text);
142
	}
143
}
144

145
.language-sep {
146
	color: var(--color-faint);
147
}
148

149
.theme-toggle {
150
	display: inline-flex;
151
	align-items: center;
152
	justify-content: center;
153
	padding: 0.25rem;
154
	border: 0;
155
	border-radius: 4px;
156
	background: none;
157
	color: var(--color-accent);
158
	cursor: pointer;
159

160
	svg {
161
		display: block;
162
		width: 1.15em;
163
		height: 1.15em;
164
		fill: none;
165
		stroke: currentColor;
166
		stroke-width: 2;
167
		stroke-linecap: round;
168
		stroke-linejoin: round;
169
	}
170

171
	.icon-sun {
172
		display: none;
173
	}
174

175
	&:hover {
176
		color: var(--color-accent-hover);
177
	}
178

179
	&:focus-visible {
180
		outline: 2px solid var(--color-accent);
181
		outline-offset: 2px;
182
	}
183
}
184

185
html[data-theme="dark"] .theme-toggle .icon-sun {
186
	display: block;
187
}
188

189
html[data-theme="dark"] .theme-toggle .icon-moon {
190
	display: none;
191
}
192

193
@media (prefers-color-scheme: dark) {
194
	html:not([data-theme="light"]) .theme-toggle .icon-sun {
195
		display: block;
196
	}
197

198
	html:not([data-theme="light"]) .theme-toggle .icon-moon {
199
		display: none;
200
	}
201
}
202

203
//html[data-theme="dark"] .logo-type {
204
//	filter: brightness(1.5);
205
//}
206
//
207
//@media (prefers-color-scheme: dark) {
208
//	html:not([data-theme="light"]) .logo-type {
209
//		filter: brightness(1.5);
210
//	}
211
//}
212

213
html[data-theme="dark"] main .highlight pre {
214
	background: var(--color-code-bg) !important;
215
}
216

217
@media (prefers-color-scheme: dark) {
218
	html:not([data-theme="light"]) main .highlight pre {
219
		background: var(--color-code-bg) !important;
220
	}
221
}
222

223
.fine-line {
224
	color: var(--color-faint);
225
}
226

227
footer {
228
	text-align: center;
229
	margin-top: 2rem;
230
	color: var(--color-muted);
231

232
	display: flex;
233
	flex-direction: column;
234
	justify-content: center;
235

236
	.links {
237
		display: flex;
238
		justify-content: center;
239
	}
240

241
	a {
242
		color: var(--color-muted);
243
	}
244
}
245

246
main {
247
	h1,
248
	h2,
249
	h3,
250
	h4 {
251
		line-height: 1.2;
252
	}
253

254
	h1 {
255
		font-size: 2.1rem;
256
	}
257

258
	h2 {
259
		margin-top: 2.5rem;
260
		font-size: 1.4rem;
261
	}
262

263
	h3 {
264
		margin-top: 2rem;
265
		font-size: 1.15rem;
266
	}
267

268
	p,
269
	ul,
270
	ol,
271
	blockquote {
272
		margin: 1rem 0;
273
	}
274

275
	ul,
276
	ol {
277
		padding-left: 1.5rem;
278
	}
279

280
	blockquote {
281
		margin-left: 0;
282
		padding-left: 1rem;
283
		border-left: 3px solid var(--color-accent);
284
		color: var(--color-muted);
285
	}
286

287
	img {
288
		max-width: 100%;
289
		height: auto;
290
	}
291

292
	hr {
293
		margin: 2rem 0;
294
		border: 0;
295
		border-top: 1px solid var(--color-rule);
296
	}
297

298
	code {
299
		padding: 0.1em 0.3em;
300
		border-radius: 3px;
301
		background: var(--color-code-bg);
302
		font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
303
		font-size: 0.85em;
304
	}
305

306
	pre {
307
		padding: 1rem;
308
		overflow-x: auto;
309
		border-radius: 4px;
310
		background: var(--color-code-bg);
311

312
		code {
313
			padding: 0;
314
			background: none;
315
			font-size: 0.8rem;
316
		}
317
	}
318

319
	table {
320
		width: 100%;
321
		margin: 1.5rem 0;
322
		border-collapse: collapse;
323
	}
324

325
	th,
326
	td {
327
		padding: 0.4rem 0.6rem;
328
		border: 1px solid var(--color-rule);
329
		text-align: left;
330
	}
331

332
	th {
333
		background: var(--color-code-bg);
334
	}
335
}
336

337
.post-meta {
338
	color: var(--color-muted);
339
	font-family: sans-serif;
340
	font-size: 0.8rem;
341
}
342

343
.work-intro {
344
	margin-bottom: 2.5rem;
345
}
346

347
.work-blurb p {
348
	color: var(--color-muted);
349
}
350

351
.project-list {
352
	margin: 0;
353
	padding: 0;
354
	list-style: none;
355
}
356

357
.project {
358
	display: grid;
359
	grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.5rem;
360
	gap: 1rem;
361
	align-items: start;
362
	padding: 1.25rem 0;
363
	border-top: 1px solid var(--color-rule);
364
}
365

366
.project:last-child {
367
	border-bottom: 1px solid var(--color-rule);
368
}
369

370
.project-index {
371
	padding-top: 0.2rem;
372
	color: var(--color-muted);
373
	font-family: sans-serif;
374
	font-size: 0.8rem;
375
}
376

377
.project-name {
378
	margin: 0;
379
	font-size: 1.15rem;
380
}
381

382
.project-name a {
383
	text-decoration: none;
384
}
385

386
.project-name a:hover {
387
	text-decoration: underline;
388
}
389

390
.project-blurb {
391
	margin: 0.35rem 0 0;
392
	color: var(--color-muted);
393
	font-size: 0.9rem;
394
}
395

396
.project-links {
397
	display: flex;
398
	flex-wrap: wrap;
399
	gap: 0.75rem;
400
	margin: 0.5rem 0 0;
401
	padding: 0;
402
	list-style: none;
403
	font-family: sans-serif;
404
	font-size: 0.75rem;
405
}
406

407
.project-tags {
408
	display: flex;
409
	flex-wrap: wrap;
410
	gap: 0.35rem;
411
	margin: 0;
412
	padding: 0;
413
	list-style: none;
414
}
415

416
.project-tags li {
417
	padding: 0.15rem 0.35rem;
418
	border: 1px solid var(--color-rule);
419
	border-radius: 3px;
420
	color: var(--color-muted);
421
	font-family: sans-serif;
422
	font-size: 0.65rem;
423
	letter-spacing: 0.06em;
424
	text-transform: uppercase;
425
}
426

427
.project-arrow {
428
	color: var(--color-accent);
429
	font-size: 1.2rem;
430
	line-height: 1;
431

432
	svg {
433
		display: block;
434
		width: 1em;
435
		height: 1em;
436
		fill: none;
437
		stroke: currentColor;
438
		stroke-width: 1.5;
439
		stroke-linecap: round;
440
		stroke-linejoin: round;
441
	}
442
}
443

444
@media (max-width: 640px) {
445
	.project {
446
		grid-template-columns: 2rem minmax(0, 1fr);
447
	}
448

449
	.project-tags {
450
		grid-column: 2;
451
	}
452

453
	.project-arrow {
454
		display: none;
455
	}
456
}
457

458
.landing p {
459
	font-style: normal;
460
	font-size: calc(calc(#{$landing-size-value} - 1) * calc(.012 * min(100vh, 900px)) + 1rem);
461
	font-weight: 400;
462
	line-height: calc(#{$landing-line-height} * (1 + (1 - #{$landing-size-value})/25));
463
	text-align: justify;
464
}
465

466
@media (max-width: 640px) {
467
	header {
468
		flex-wrap: wrap;
469
	}
470

471
	header nav {
472
		order: 3;
473
		width: 100%;
474
		margin-top: 0.75rem;
475
		padding-left: 0;
476
	}
477

478
	.header-actions {
479
		margin-left: auto;
480
	}
481
}