From 4cb1bfe0fc8deeb3a93918ab9ac36711bb156b81 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 27 Jul 2026 18:59:12 +0200 Subject: [PATCH] Add Source Code Pro fallback font styles and README --- editor-style.css | 40 ++++++++++++++++++++++++++---- style.css | 64 +++++++++++++++++++++++++++++++++++------------- theme.json | 2 +- 3 files changed, 83 insertions(+), 23 deletions(-) diff --git a/editor-style.css b/editor-style.css index 2e3a8b9..6cbc492 100644 --- a/editor-style.css +++ b/editor-style.css @@ -42,6 +42,36 @@ font-display: swap; } +/* Public fallback for the locally licensed Berkeley Mono face. */ +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Regular.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Bold.woff2") format("woff2"); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Italic.woff2") format("woff2"); + font-weight: 400; + font-style: italic; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-BoldItalic.woff2") format("woff2"); + font-weight: 700; + font-style: italic; + font-display: swap; +} + /* Match the frontend's light canvas. The admin chrome is intentionally untouched. */ body.editor-styles-wrapper { /* The canvas may be wide; theme.json constrains normal blocks to contentSize. */ @@ -169,7 +199,7 @@ body.editor-styles-wrapper { .editor-styles-wrapper .wp-block-code .block-editor-plain-text, .editor-styles-wrapper .wp-block-preformatted .block-editor-rich-text__editable { /* Code blocks use editable controls rather than a rendered element. */ - font-family: "Berkeley Mono", monospace !important; + font-family: "Berkeley Mono", "Source Code Pro", monospace !important; font-size: 0.8em; } @@ -199,7 +229,7 @@ body.editor-styles-wrapper { .editor-styles-wrapper .wp-element-caption, .editor-styles-wrapper .wp-caption-text { color: #706a63; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } @@ -216,7 +246,7 @@ body.editor-styles-wrapper { border-radius: 2px; background: #c3480b; color: #fff; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.04em; } @@ -244,7 +274,7 @@ body.editor-styles-wrapper { } .editor-styles-wrapper .wp-block-table th { - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1em; } @@ -253,7 +283,7 @@ body.editor-styles-wrapper { .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-pullquote cite { color: #706a63; - font-family: "Berkeley Mono", monospace !important; + font-family: "Berkeley Mono", "Source Code Pro", monospace !important; font-size: 1rem; font-style: normal; } diff --git a/style.css b/style.css index 3e3773f..685eb7d 100644 --- a/style.css +++ b/style.css @@ -46,6 +46,36 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html font-display: swap; } +/* Public fallback for systems that cannot load the privately licensed Berkeley Mono. */ +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Regular.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Bold.woff2") format("woff2"); + font-weight: 700; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-Italic.woff2") format("woff2"); + font-weight: 400; + font-style: italic; + font-display: swap; +} +@font-face { + font-family: "Source Code Pro"; + src: url("fonts/SourceCodePro-BoldItalic.woff2") format("woff2"); + font-weight: 700; + font-style: italic; + font-display: swap; +} + /* Shared palette, layout, and code tokens; dark mode overrides the same names below. */ :root { color-scheme: light; @@ -223,7 +253,7 @@ button { .site-description { margin: 0.1rem 0 0; color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.07em; } @@ -234,7 +264,7 @@ button { margin: 0; padding: 0; list-style: none; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.04em; } @@ -314,7 +344,7 @@ input[type="submit"] { border-radius: 2px; background: var(--accent); color: #fff; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.04em; } @@ -365,7 +395,7 @@ h4 { .entry-footer, .taxonomy { color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.035em; } @@ -485,7 +515,7 @@ h4 { font-size: 0.8em; } .entry-content code { - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 0.8em; } @@ -577,7 +607,7 @@ h4 { } .wp-caption-text { color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } .wp-block-separator { @@ -589,7 +619,7 @@ h4 { .wp-element-caption, .entry-content figcaption { color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } @@ -599,7 +629,7 @@ h4 { border-radius: 2px; background: var(--accent); color: #fff; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.04em; text-decoration: none; @@ -638,7 +668,7 @@ h4 { .wp-block-table th { background: var(--surface); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1em; } @@ -651,7 +681,7 @@ h4 { .wp-block-quote cite, .wp-block-pullquote cite { color: var(--muted); - font-family: "Berkeley Mono", monospace !important; + font-family: "Berkeley Mono", "Source Code Pro", monospace !important; font-size: 1rem; font-style: normal; } @@ -722,7 +752,7 @@ h4 { margin: auto; } .hero-eyebrow { - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; @@ -754,7 +784,7 @@ h4 { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; } /* Archive and search pagination follows the wide page-title alignment. */ .pagination { @@ -873,7 +903,7 @@ h4 { align-items: center; gap: 0.8rem; color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; line-height: 1.35; } @@ -922,13 +952,13 @@ h4 { .comment-awaiting-moderation { margin: 1rem 0 0; color: var(--accent); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } .comment-actions { margin-top: 1.25rem; - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } @@ -936,7 +966,7 @@ h4 { .comment-form .logged-in-as, .comment-form .comment-notes, .comment-form .form-submit { - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } .comment-form input:not([type="submit"]), @@ -951,7 +981,7 @@ h4 { padding: 2.5rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); - font-family: "Berkeley Mono", monospace; + font-family: "Berkeley Mono", "Source Code Pro", monospace; font-size: 1rem; } .footer-inner { diff --git a/theme.json b/theme.json index 506c3e7..7d390e6 100644 --- a/theme.json +++ b/theme.json @@ -95,7 +95,7 @@ ] }, { - "fontFamily": "\"Berkeley Mono\", monospace", + "fontFamily": "\"Berkeley Mono\", \"Source Code Pro\", monospace", "name": "Berkeley Mono", "slug": "berkeley-mono", "fontFace": [