cabotia / cabotia.dev/ assets/main.scssb83d5428c24874b97ae20a716ebe67a6601a489b
7.6 KB | 527 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.15;
252
		text-wrap: balance;
253
	}
254

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

259
	h2 {
260
		margin-top: 3rem;
261
		margin-bottom: 1rem;
262
		font-size: 1.75rem;
263

264
		&::after {
265
			content: "";
266
			display: block;
267
			width: 3rem;
268
			height: 3px;
269
			margin-top: 0.6rem;
270
			border-radius: 2px;
271
			background: var(--color-accent);
272
		}
273
	}
274

275
	h3 {
276
		margin-top: 2rem;
277
		margin-bottom: 0.5rem;
278
		font-size: 1.25rem;
279
		line-height: 1.2;
280
	}
281

282
	p,
283
	ul,
284
	ol,
285
	blockquote {
286
		margin: 1rem 0;
287
	}
288

289
	ul,
290
	ol {
291
		padding-left: 1.5rem;
292
	}
293

294
	blockquote {
295
		margin-left: 0;
296
		padding-left: 1rem;
297
		border-left: 3px solid var(--color-accent);
298
		color: var(--color-muted);
299
	}
300

301
	img {
302
		max-width: 100%;
303
		height: auto;
304
	}
305

306
	hr {
307
		margin: 2rem 0;
308
		border: 0;
309
		border-top: 1px solid var(--color-rule);
310
	}
311

312
	code {
313
		padding: 0.1em 0.3em;
314
		border-radius: 3px;
315
		background: var(--color-code-bg);
316
		font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
317
		font-size: 0.85em;
318
	}
319

320
	pre {
321
		padding: 1rem;
322
		overflow-x: auto;
323
		border-radius: 4px;
324
		background: var(--color-code-bg);
325

326
		code {
327
			padding: 0;
328
			background: none;
329
			font-size: 0.8rem;
330
		}
331
	}
332

333
	table {
334
		width: 100%;
335
		margin: 1.5rem 0;
336
		border-collapse: collapse;
337
	}
338

339
	th,
340
	td {
341
		padding: 0.4rem 0.6rem;
342
		border: 1px solid var(--color-rule);
343
		text-align: left;
344
	}
345

346
	th {
347
		background: var(--color-code-bg);
348
	}
349
}
350

351
.post-meta {
352
	color: var(--color-muted);
353
	font-family: sans-serif;
354
	font-size: 0.8rem;
355
}
356

357
.post-title {
358
	margin-top: 2.5rem;
359
	margin-bottom: 1rem;
360
	font-size: 1.4rem;
361
	line-height: 1.2;
362

363
	&::after {
364
		display: none;
365
	}
366
}
367

368
.post-translations {
369
	margin-top: 2rem;
370
	color: var(--color-muted);
371
	font-family: sans-serif;
372
	font-size: 0.8rem;
373
}
374

375
.empty-state {
376
	margin: 2rem 0;
377
	padding: 1.5rem;
378
	border: 1px dashed var(--color-rule);
379
	border-radius: 4px;
380
	color: var(--color-muted);
381
	text-align: center;
382
}
383

384
.work-intro {
385
	margin-bottom: 2.5rem;
386
}
387

388
.work-blurb p {
389
	color: var(--color-muted);
390
}
391

392
.project-list {
393
	margin: 0;
394
	padding: 0;
395
	list-style: none;
396
}
397

398
.project {
399
	display: grid;
400
	grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.5rem;
401
	gap: 1rem;
402
	align-items: start;
403
	padding: 1.25rem 0;
404
	border-top: 1px solid var(--color-rule);
405
}
406

407
.project:last-child {
408
	border-bottom: 1px solid var(--color-rule);
409
}
410

411
.project-index {
412
	padding-top: 0.2rem;
413
	color: var(--color-muted);
414
	font-family: sans-serif;
415
	font-size: 0.8rem;
416
}
417

418
.project-name {
419
	margin: 0;
420
	font-size: 1.15rem;
421
	line-height: 1.2;
422

423
	&::after {
424
		display: none;
425
	}
426
}
427

428
.project-name a {
429
	text-decoration: none;
430
}
431

432
.project-name a:hover {
433
	text-decoration: underline;
434
}
435

436
.project-blurb {
437
	margin: 0.35rem 0 0;
438
	color: var(--color-muted);
439
	font-size: 0.9rem;
440
}
441

442
.project-links {
443
	display: flex;
444
	flex-wrap: wrap;
445
	gap: 0.75rem;
446
	margin: 0.5rem 0 0;
447
	padding: 0;
448
	list-style: none;
449
	font-family: sans-serif;
450
	font-size: 0.75rem;
451
}
452

453
.project-tags {
454
	display: flex;
455
	flex-wrap: wrap;
456
	gap: 0.35rem;
457
	margin: 0;
458
	padding: 0;
459
	list-style: none;
460
}
461

462
.project-tags li {
463
	padding: 0.15rem 0.35rem;
464
	border: 1px solid var(--color-rule);
465
	border-radius: 3px;
466
	color: var(--color-muted);
467
	font-family: sans-serif;
468
	font-size: 0.65rem;
469
	letter-spacing: 0.06em;
470
	text-transform: uppercase;
471
}
472

473
.project-arrow {
474
	color: var(--color-accent);
475
	font-size: 1.2rem;
476
	line-height: 1;
477

478
	svg {
479
		display: block;
480
		width: 1em;
481
		height: 1em;
482
		fill: none;
483
		stroke: currentColor;
484
		stroke-width: 1.5;
485
		stroke-linecap: round;
486
		stroke-linejoin: round;
487
	}
488
}
489

490
@media (max-width: 640px) {
491
	.project {
492
		grid-template-columns: 2rem minmax(0, 1fr);
493
	}
494

495
	.project-tags {
496
		grid-column: 2;
497
	}
498

499
	.project-arrow {
500
		display: none;
501
	}
502
}
503

504
.landing p {
505
	font-style: normal;
506
	font-size: calc(calc(#{$landing-size-value} - 1) * calc(.012 * min(100vh, 900px)) + 1rem);
507
	font-weight: 400;
508
	line-height: calc(#{$landing-line-height} * (1 + (1 - #{$landing-size-value})/25));
509
	text-align: justify;
510
}
511

512
@media (max-width: 640px) {
513
	header {
514
		flex-wrap: wrap;
515
	}
516

517
	header nav {
518
		order: 3;
519
		width: 100%;
520
		margin-top: 0.75rem;
521
		padding-left: 0;
522
	}
523

524
	.header-actions {
525
		margin-left: auto;
526
	}
527
}