add light mode

This commit is contained in:
John Gatward committed 2026-10-08 12:21:58 +01:00
1 parent 874ea1f8bf
commit c744979818
11 files changed
+689 -35

No files matched your search

+132 -13
View File
@@ -6,8 +6,9 @@
src: url('fonts/geist-variable.ttf') format('truetype');
}
/* ─── Catppuccin Mocha ─────────────────────────────────── */
/* ─── Catppuccin themes ────────────────────────────────── */
:root {
color-scheme: light dark;
--font-body: 'Geist', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', monospace;
--base: #1e1e2e;
@@ -36,6 +37,70 @@
--pink: #f5c2e7;
--flamingo: #f2cdcd;
--rosewater: #f5e0dc;
--nav-background: rgba(17, 17, 27, 0.85);
--accent-soft: rgba(203, 166, 247, 0.15);
--accent-selected: rgba(203, 166, 247, 0.18);
--accent-border: rgba(203, 166, 247, 0.7);
--on-accent: #11111b;
--link-accent: var(--mauve);
}
:root[data-theme='light'] {
color-scheme: light;
}
:root[data-theme='dark'] {
color-scheme: dark;
}
/* Catppuccin Latte / Mocha; older browsers retain the original Mocha palette. */
@supports (color: light-dark(#eff1f5, #1e1e2e)) {
:root {
--base: light-dark(#eff1f5, #1e1e2e);
--mantle: light-dark(#e6e9ef, #181825);
--crust: light-dark(#dce0e8, #11111b);
--surface0: light-dark(#ccd0da, #313244);
--surface1: light-dark(#bcc0cc, #45475a);
--surface2: light-dark(#acb0be, #585b70);
--overlay0: light-dark(#9ca0b0, #6c7086);
--overlay1: light-dark(#8c8fa1, #7f849c);
--overlay2: light-dark(#7c7f93, #9399b2);
--text: light-dark(#4c4f69, #cdd6f4);
--subtext0: light-dark(#60647b, #a6adc8);
--subtext1: light-dark(#5c5f77, #bac2de);
--lavender: light-dark(#7287fd, #b4befe);
--blue: light-dark(#1e66f5, #89b4fa);
--sapphire: light-dark(#209fb5, #74c7ec);
--sky: light-dark(#04a5e5, #89dceb);
--teal: light-dark(#179299, #94e2d5);
--green: light-dark(#40a02b, #a6e3a1);
--yellow: light-dark(#df8e1d, #f9e2af);
--peach: light-dark(#fe640b, #fab387);
--maroon: light-dark(#e64553, #eba0ac);
--red: light-dark(#d20f39, #f38ba8);
--mauve: light-dark(#8839ef, #cba6f7);
--pink: light-dark(#ea76cb, #f5c2e7);
--flamingo: light-dark(#dd7878, #f2cdcd);
--rosewater: light-dark(#dc8a78, #f5e0dc);
--nav-background: light-dark(
rgba(239, 241, 245, 0.94),
rgba(17, 17, 27, 0.85)
);
--accent-soft: light-dark(
rgba(136, 57, 239, 0.03),
rgba(203, 166, 247, 0.15)
);
--accent-selected: light-dark(
rgba(136, 57, 239, 0.03),
rgba(203, 166, 247, 0.18)
);
--accent-border: light-dark(
rgba(136, 57, 239, 0.7),
rgba(203, 166, 247, 0.7)
);
--on-accent: light-dark(#eff1f5, #11111b);
--link-accent: light-dark(#8235e6, #cba6f7);
}
}
*,
@@ -80,7 +145,7 @@ footer {
::selection {
background: var(--mauve);
color: var(--crust);
color: var(--on-accent);
}
:focus-visible {
@@ -96,7 +161,7 @@ footer {
padding: 0.6rem 1rem;
border-radius: 4px;
background: var(--mauve);
color: var(--crust);
color: var(--on-accent);
font-size: 0.8rem;
font-weight: 700;
text-decoration: none;
@@ -138,7 +203,7 @@ nav {
justify-content: space-between;
padding: 0 3rem;
height: 56px;
background: rgba(17, 17, 27, 0.85);
background: var(--nav-background);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--surface0);
}
@@ -160,6 +225,48 @@ nav {
list-style: none;
}
.nav-actions {
display: flex;
align-items: center;
gap: 1.5rem;
}
.theme-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 44px;
width: 44px;
padding: 0.5rem;
border: 1px solid transparent;
border-radius: 4px;
background: transparent;
color: var(--subtext1);
cursor: pointer;
transition:
color 0.2s,
background-color 0.2s;
}
.theme-toggle:hover {
background: var(--accent-soft);
color: var(--mauve);
}
.theme-icon {
display: block;
width: 22px;
height: 22px;
background: currentColor;
-webkit-mask: url('icons/sun.svg') center / contain no-repeat;
mask: url('icons/sun.svg') center / contain no-repeat;
}
.theme-toggle[data-theme='dark'] .theme-icon {
-webkit-mask-image: url('icons/moon.svg');
mask-image: url('icons/moon.svg');
}
.nav-links a,
.mobile-nav-links a {
display: flex;
@@ -298,7 +405,7 @@ section.full-width {
.btn-primary {
background: var(--mauve);
color: var(--crust);
color: var(--on-accent);
}
.btn-primary:hover {
@@ -320,6 +427,7 @@ section.full-width {
}
.btn:active,
.theme-toggle:active,
.filter-chip:active,
.projects-more-btn:active {
transform: scale(0.98);
@@ -495,7 +603,7 @@ section.full-width {
font-size: 0.6rem;
letter-spacing: 0.08em;
text-transform: uppercase;
background: rgba(203, 166, 247, 0.15);
background: var(--accent-soft);
color: var(--mauve);
padding: 0.1rem 0.45rem;
border-radius: 3px;
@@ -570,7 +678,7 @@ section.full-width {
letter-spacing: 0.04em;
font-weight: 700;
background: var(--surface0);
color: var(--subtext1);
color: var(--text);
}
/* ─── Tutorials / Projects shared ─────────────────────── */
@@ -662,10 +770,17 @@ section.full-width {
#project-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 1rem;
background: transparent;
border: none;
border-radius: 0;
overflow: visible;
}
#project-grid .card {
padding: 1.2rem;
border: 1px solid var(--surface0);
border-radius: 8px;
}
.project-filters {
@@ -699,8 +814,8 @@ section.full-width {
}
.filter-chip.active {
background: rgba(203, 166, 247, 0.18);
border-color: rgba(203, 166, 247, 0.7);
background: var(--accent-selected);
border-color: var(--accent-border);
color: var(--mauve);
}
@@ -848,13 +963,13 @@ section.full-width {
align-items: center;
min-height: 44px;
padding: 0 0.25rem;
color: var(--mauve);
color: var(--link-accent);
text-decoration: underline;
text-underline-offset: 2px;
}
.card-source a:hover {
color: var(--mauve);
color: var(--link-accent);
}
.card-desc a {
@@ -863,13 +978,13 @@ section.full-width {
display: inline-flex;
align-items: center;
min-height: 44px;
color: var(--mauve);
color: var(--link-accent);
text-decoration: underline;
text-underline-offset: 2px;
}
.card-desc a:hover {
color: var(--mauve);
color: var(--link-accent);
}
/* ─── Contact ──────────────────────────────────────────── */
@@ -1074,6 +1189,10 @@ footer a:hover {
}
@media (max-width: 540px) {
.nav-actions {
gap: 0.75rem;
}
.nav-links {
display: none;
}