Skip to content

Commit 40580c6

Browse files
committed
Basic dark mode for index.
1 parent c9ccecc commit 40580c6

File tree

1 file changed

+45
-6
lines changed

1 file changed

+45
-6
lines changed

css/index.css

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
--color-bg: hsl(0, 0%, 100%);
1010
--color-accent: hsl(0, 0%, 16%);
1111
--color-accent-hover: hsl(146, 24%, 32%);
12+
--color-border: hsl(0, 0%, 0%);
1213
}
1314

1415
html { font-size: 62.5%; }
@@ -227,7 +228,7 @@ em, i { font-style: italic; }
227228

228229
/* ─── Decorative services box ────────────────────────────── */
229230
.decorative {
230-
border: 1px solid #000;
231+
border: 1px solid var(--color-border);
231232
padding: 8.5rem;
232233
margin-bottom: 12rem;
233234
position: relative;
@@ -240,7 +241,7 @@ em, i { font-style: italic; }
240241
background: var(--color-bg);
241242
padding: 0 2rem;
242243
font-size: 3.4rem;
243-
font-family: var(--font-main);
244+
font-family: var(--font-base);
244245
font-weight: 700;
245246
text-transform: uppercase;
246247
white-space: nowrap;
@@ -391,7 +392,7 @@ em, i { font-style: italic; }
391392
font-weight: 600;
392393
font-size: 20px;
393394
border-radius: 0;
394-
border: 1px solid #000;
395+
border: 1px solid var(--color-border);
395396
position: relative;
396397
line-height: 1;
397398
padding: 2.4rem;
@@ -417,8 +418,8 @@ em, i { font-style: italic; }
417418
left: -0.6rem;
418419
width: 1.1rem;
419420
height: 1.1rem;
420-
background: #000;
421-
border: 5px solid #fff;
421+
background: var(--color-text);
422+
border: 5px solid var(--color-bg);
422423
}
423424
.btn .dots.dots-left { left: 0; }
424425
.btn .dots.dots-left::after { top: auto; bottom: -0.6rem; }
@@ -431,11 +432,49 @@ em, i { font-style: italic; }
431432
.btn:hover .dots::after,
432433
.btn:focus .dots::before,
433434
.btn:focus .dots::after {
434-
border: 0px solid #fff;
435+
border: 0px solid var(--color-bg);
435436
width: 0;
436437
height: 0;
437438
transition: border 0.5s, width 0.5s, height 0.5s;
438439
}
439440

440441
/* ─── Misc ───────────────────────────────────────────────── */
441442
b, strong { font-weight: 700; }
443+
444+
/* ─── Dark mode ──────────────────────────────────────────── */
445+
@media (prefers-color-scheme: dark) {
446+
:root {
447+
--color-text: hsl(0, 0%, 88%);
448+
--color-bg: hsl(0, 0%, 10%);
449+
--color-accent: hsl(0, 0%, 75%);
450+
--color-accent-hover: hsl(146, 24%, 55%);
451+
--color-border: hsl(0, 0%, 75%);
452+
}
453+
454+
/* Book hero: no image in dark mode until replacement found */
455+
.book {
456+
background-image: none;
457+
height: auto;
458+
padding: 4rem 0;
459+
}
460+
.book-wrapper { flex: 0 0 auto; }
461+
.book-title { color: var(--color-text); text-shadow: none; }
462+
/* Remove content overlap — no hero image to overlap into */
463+
.content { top: 0; }
464+
465+
/* Scroll arrow: black SVG → white */
466+
.book-scroll::before { filter: invert(1); }
467+
468+
/* Divider SVGs: black → white */
469+
.divider::before,
470+
.divider-end::before { filter: invert(1); }
471+
472+
/* Corner ornaments: invert SVG, clear bg so dark bg shows through */
473+
.decorative-ornament-left::before,
474+
.decorative-ornament-left::after,
475+
.decorative-ornament-right::before,
476+
.decorative-ornament-right::after {
477+
background-color: transparent;
478+
filter: invert(1);
479+
}
480+
}

0 commit comments

Comments
 (0)