-
- {
- posts.map((post) => (
- -
- {/* div prevents misaligned bullets in Firefox */}
-
-
- ))
- }
-
+
diff --git a/src/styles/global.css b/src/styles/global.css
index a7a83289..169b48bb 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -1,173 +1,247 @@
-/*
- The CSS in this style tag is based off of Bear Blog's default CSS.
- https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css
- License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
- */
-
:root {
- --accent: #2337ff;
- --accent-dark: #000d8a;
- --black: 15, 18, 25;
- --gray: 96, 115, 159;
- --gray-light: 229, 233, 240;
- --gray-dark: 34, 41, 57;
--bg: #ffffff;
- --surface: #ffffff;
- --gray-gradient: rgba(var(--gray-light), 50%), var(--bg);
- --box-shadow: 0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
- 0 16px 32px rgba(var(--gray), 33%);
+ --text: #1f2328;
+ --heading: #0d1117;
+ --muted: #5b6470;
+ --border: #e6e8eb;
+ --surface: #f5f6f8;
+ --accent: #2f4ee0;
+ --accent-soft: rgba(47, 78, 224, 0.1);
+ --code-bg: #f5f6f8;
+ --code-text: #1f2328;
+ --font-sans: "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
+ --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
+ --width: 44rem;
color-scheme: light;
}
html.dark {
- --accent: #5c6fff;
- --accent-dark: #8b97ff;
- --black: 248, 250, 252;
- --gray: 148, 163, 184;
- --gray-light: 30, 41, 59;
- --gray-dark: 203, 213, 225;
- --bg: #0b0d12;
- --surface: #151a21;
- --box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35),
- 0 16px 32px rgba(0, 0, 0, 0.3);
+ --bg: #0f1115;
+ --text: #d6dae0;
+ --heading: #f3f4f6;
+ --muted: #98a1ad;
+ --border: #262a31;
+ --surface: #171a20;
+ --accent: #8fa1ff;
+ --accent-soft: rgba(143, 161, 255, 0.14);
+ --code-bg: #171a20;
+ --code-text: #d6dae0;
color-scheme: dark;
}
-@font-face {
- font-family: 'Atkinson';
- src: url('/fonts/atkinson-regular.woff') format('woff');
- font-weight: 400;
- font-style: normal;
- font-display: swap;
-}
-@font-face {
- font-family: 'Atkinson';
- src: url('/fonts/atkinson-bold.woff') format('woff');
- font-weight: 700;
- font-style: normal;
- font-display: swap;
+
+*,
+*::before,
+*::after {
+ box-sizing: border-box;
}
+
body {
- font-family: 'Atkinson', sans-serif;
margin: 0;
- padding: 0;
- text-align: left;
- background-color: var(--bg);
- background-image: linear-gradient(var(--gray-gradient));
- background-repeat: no-repeat;
- background-size: 100% 600px;
- word-wrap: break-word;
- overflow-wrap: break-word;
- color: rgb(var(--gray-dark));
- font-size: 20px;
+ background: var(--bg);
+ color: var(--text);
+ font-family: var(--font-sans);
+ font-size: 17px;
line-height: 1.7;
+ -webkit-font-smoothing: antialiased;
+ overflow-wrap: break-word;
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
}
+
main {
- width: 720px;
- max-width: calc(100% - 2em);
- margin: auto;
- padding: 3em 1em;
+ flex: 1;
+ width: 100%;
+ max-width: var(--width);
+ margin: 0 auto;
+ padding: 3rem 1.25rem 4rem;
}
+
h1,
h2,
h3,
h4,
h5,
h6 {
- margin: 0 0 0.5rem 0;
- color: rgb(var(--black));
- line-height: 1.2;
+ margin: 2.25rem 0 0.75rem;
+ color: var(--heading);
+ font-weight: 650;
+ line-height: 1.25;
+ letter-spacing: -0.015em;
}
h1 {
- font-size: 3.052em;
+ font-size: 2.25rem;
+ letter-spacing: -0.025em;
}
h2 {
- font-size: 2.441em;
+ font-size: 1.5rem;
}
h3 {
- font-size: 1.953em;
+ font-size: 1.25rem;
}
h4 {
- font-size: 1.563em;
+ font-size: 1.125rem;
}
-h5 {
- font-size: 1.25em;
+h5,
+h6 {
+ font-size: 1rem;
}
-strong,
-b {
- font-weight: 700;
+
+p,
+ul,
+ol,
+pre,
+blockquote,
+table {
+ margin: 0 0 1.25rem;
}
+
a {
color: var(--accent);
+ text-decoration: underline;
+ text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
+ text-underline-offset: 3px;
}
a:hover {
- color: var(--accent);
+ text-decoration-color: var(--accent);
}
-p {
- margin-bottom: 1em;
-}
-.prose p {
- margin-bottom: 2em;
-}
-textarea {
- width: 100%;
- font-size: 16px;
-}
-input {
- font-size: 16px;
-}
-table {
- width: 100%;
+
+strong,
+b {
+ font-weight: 650;
+ color: var(--heading);
}
+
img {
max-width: 100%;
height: auto;
border-radius: 8px;
}
+
code {
- padding: 2px 5px;
- background-color: rgb(var(--gray-light));
- border-radius: 2px;
+ font-family: var(--font-mono);
+ font-size: 0.85em;
+ padding: 0.15em 0.4em;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 5px;
}
+
pre {
- padding: 1.5em;
- border-radius: 8px;
+ padding: 1rem 1.25rem;
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ overflow-x: auto;
+ font-size: 0.875rem;
+ line-height: 1.65;
+}
+pre,
+pre.astro-code {
+ background: var(--code-bg);
+ color: var(--code-text);
+}
+.astro-code span {
+ color: var(--shiki-light);
+}
+html.dark .astro-code span {
+ color: var(--shiki-dark);
}
pre > code {
all: unset;
+ font-family: var(--font-mono);
}
+
blockquote {
- border-left: 4px solid var(--accent);
- padding: 0 0 0 20px;
- margin: 0px;
- font-size: 1.333em;
+ padding: 0.25rem 0 0.25rem 1.25rem;
+ border-left: 3px solid var(--border);
+ color: var(--muted);
}
+
hr {
+ margin: 2.5rem 0;
border: none;
- border-top: 1px solid rgb(var(--gray-light));
+ border-top: 1px solid var(--border);
+}
+
+table {
+ width: 100%;
+ border-collapse: collapse;
+}
+th,
+td {
+ padding: 0.5rem;
+ border-bottom: 1px solid var(--border);
+ text-align: left;
+}
+
+textarea,
+input {
+ font: inherit;
+ font-size: 16px;
+}
+
+.muted {
+ color: var(--muted);
+}
+
+/* A compact list of posts: date on the left, title on the right. */
+.post-list {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+.post-list li {
+ display: grid;
+ grid-template-columns: 7.5rem minmax(0, 1fr);
+ gap: 1rem;
+ padding: 0.6rem 0;
+ align-items: baseline;
+}
+.post-list time {
+ color: var(--muted);
+ font-size: 0.9rem;
+ font-variant-numeric: tabular-nums;
+}
+.post-list a {
+ color: var(--heading);
+ font-weight: 550;
+ text-decoration: none;
}
-@media (max-width: 720px) {
+.post-list a:hover {
+ color: var(--accent);
+}
+.post-list .description {
+ display: block;
+ margin-top: 0.15rem;
+ color: var(--muted);
+ font-size: 0.95rem;
+}
+
+@media (max-width: 560px) {
body {
- font-size: 18px;
+ font-size: 16px;
}
main {
- padding: 1em;
+ padding: 2rem 1rem 3rem;
+ }
+ h1 {
+ font-size: 1.875rem;
+ }
+ .post-list li {
+ grid-template-columns: 1fr;
+ gap: 0.1rem;
+ padding: 0.75rem 0;
}
}
.sr-only {
- border: 0;
- padding: 0;
- margin: 0;
position: absolute !important;
- height: 1px;
width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
overflow: hidden;
- /* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */
- clip: rect(1px 1px 1px 1px);
- /* maybe deprecated but we need to support legacy browsers */
- clip: rect(1px, 1px, 1px, 1px);
- /* modern browsers, clip-path works inwards from each corner */
clip-path: inset(50%);
- /* added line to stop words getting smushed together (as they go onto seperate lines and some screen readers do not understand line feeds as a space */
white-space: nowrap;
+ border: 0;
}
diff --git a/tests/visual.spec.ts-snapshots/about-desktop.png b/tests/visual.spec.ts-snapshots/about-desktop.png
index f0221804..2e1e7e4f 100644
Binary files a/tests/visual.spec.ts-snapshots/about-desktop.png and b/tests/visual.spec.ts-snapshots/about-desktop.png differ
diff --git a/tests/visual.spec.ts-snapshots/about-mobile.png b/tests/visual.spec.ts-snapshots/about-mobile.png
index 020f315a..d24c0f47 100644
Binary files a/tests/visual.spec.ts-snapshots/about-mobile.png and b/tests/visual.spec.ts-snapshots/about-mobile.png differ
diff --git a/tests/visual.spec.ts-snapshots/blog-index-desktop.png b/tests/visual.spec.ts-snapshots/blog-index-desktop.png
index 30039807..1289db1d 100644
Binary files a/tests/visual.spec.ts-snapshots/blog-index-desktop.png and b/tests/visual.spec.ts-snapshots/blog-index-desktop.png differ
diff --git a/tests/visual.spec.ts-snapshots/blog-index-mobile.png b/tests/visual.spec.ts-snapshots/blog-index-mobile.png
index e5ba151b..caa50d77 100644
Binary files a/tests/visual.spec.ts-snapshots/blog-index-mobile.png and b/tests/visual.spec.ts-snapshots/blog-index-mobile.png differ
diff --git a/tests/visual.spec.ts-snapshots/blog-post-desktop.png b/tests/visual.spec.ts-snapshots/blog-post-desktop.png
index e2b34a0b..094ecca0 100644
Binary files a/tests/visual.spec.ts-snapshots/blog-post-desktop.png and b/tests/visual.spec.ts-snapshots/blog-post-desktop.png differ
diff --git a/tests/visual.spec.ts-snapshots/blog-post-mobile.png b/tests/visual.spec.ts-snapshots/blog-post-mobile.png
index d3ff474c..100b08b7 100644
Binary files a/tests/visual.spec.ts-snapshots/blog-post-mobile.png and b/tests/visual.spec.ts-snapshots/blog-post-mobile.png differ
diff --git a/tests/visual.spec.ts-snapshots/home-desktop.png b/tests/visual.spec.ts-snapshots/home-desktop.png
index 7d05f16b..975191f3 100644
Binary files a/tests/visual.spec.ts-snapshots/home-desktop.png and b/tests/visual.spec.ts-snapshots/home-desktop.png differ
diff --git a/tests/visual.spec.ts-snapshots/home-mobile.png b/tests/visual.spec.ts-snapshots/home-mobile.png
index e89133c6..40d85e2a 100644
Binary files a/tests/visual.spec.ts-snapshots/home-mobile.png and b/tests/visual.spec.ts-snapshots/home-mobile.png differ