cabotia / cabotia.dev/ assets/main.scss5d986b13949cef9204ed7c135e244bf8b81e3f9f
7.2 KB | 497 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
.post-translations {
344
	margin-top: 2rem;
345
	color: var(--color-muted);
346
	font-family: sans-serif;
347
	font-size: 0.8rem;
348
}
349

350
.empty-state {
351
	margin: 2rem 0;
352
	padding: 1.5rem;
353
	border: 1px dashed var(--color-rule);
354
	border-radius: 4px;
355
	color: var(--color-muted);
356
	text-align: center;
357
}
358

359
.work-intro {
360
	margin-bottom: 2.5rem;
361
}
362

363
.work-blurb p {
364
	color: var(--color-muted);
365
}
366

367
.project-list {
368
	margin: 0;
369
	padding: 0;
370
	list-style: none;
371
}
372

373
.project {
374
	display: grid;
375
	grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.5rem;
376
	gap: 1rem;
377
	align-items: start;
378
	padding: 1.25rem 0;
379
	border-top: 1px solid var(--color-rule);
380
}
381

382
.project:last-child {
383
	border-bottom: 1px solid var(--color-rule);
384
}
385

386
.project-index {
387
	padding-top: 0.2rem;
388
	color: var(--color-muted);
389
	font-family: sans-serif;
390
	font-size: 0.8rem;
391
}
392

393
.project-name {
394
	margin: 0;
395
	font-size: 1.15rem;
396
}
397

398
.project-name a {
399
	text-decoration: none;
400
}
401

402
.project-name a:hover {
403
	text-decoration: underline;
404
}
405

406
.project-blurb {
407
	margin: 0.35rem 0 0;
408
	color: var(--color-muted);
409
	font-size: 0.9rem;
410
}
411

412
.project-links {
413
	display: flex;
414
	flex-wrap: wrap;
415
	gap: 0.75rem;
416
	margin: 0.5rem 0 0;
417
	padding: 0;
418
	list-style: none;
419
	font-family: sans-serif;
420
	font-size: 0.75rem;
421
}
422

423
.project-tags {
424
	display: flex;
425
	flex-wrap: wrap;
426
	gap: 0.35rem;
427
	margin: 0;
428
	padding: 0;
429
	list-style: none;
430
}
431

432
.project-tags li {
433
	padding: 0.15rem 0.35rem;
434
	border: 1px solid var(--color-rule);
435
	border-radius: 3px;
436
	color: var(--color-muted);
437
	font-family: sans-serif;
438
	font-size: 0.65rem;
439
	letter-spacing: 0.06em;
440
	text-transform: uppercase;
441
}
442

443
.project-arrow {
444
	color: var(--color-accent);
445
	font-size: 1.2rem;
446
	line-height: 1;
447

448
	svg {
449
		display: block;
450
		width: 1em;
451
		height: 1em;
452
		fill: none;
453
		stroke: currentColor;
454
		stroke-width: 1.5;
455
		stroke-linecap: round;
456
		stroke-linejoin: round;
457
	}
458
}
459

460
@media (max-width: 640px) {
461
	.project {
462
		grid-template-columns: 2rem minmax(0, 1fr);
463
	}
464

465
	.project-tags {
466
		grid-column: 2;
467
	}
468

469
	.project-arrow {
470
		display: none;
471
	}
472
}
473

474
.landing p {
475
	font-style: normal;
476
	font-size: calc(calc(#{$landing-size-value} - 1) * calc(.012 * min(100vh, 900px)) + 1rem);
477
	font-weight: 400;
478
	line-height: calc(#{$landing-line-height} * (1 + (1 - #{$landing-size-value})/25));
479
	text-align: justify;
480
}
481

482
@media (max-width: 640px) {
483
	header {
484
		flex-wrap: wrap;
485
	}
486

487
	header nav {
488
		order: 3;
489
		width: 100%;
490
		margin-top: 0.75rem;
491
		padding-left: 0;
492
	}
493

494
	.header-actions {
495
		margin-left: auto;
496
	}
497
}