refactor(tokens): make token layer authoritative and wire to layout

- Imported tokens.css directly into BaseLayout.astro.
- Removed legacy :root variable definitions from chapters.css, skills-review/styles.css, rules/styles.css, and styles.css.
- Added self-hosted --font-sans and --font-mono to tokens.css and updated legacy font stacks.
- Removed base.css.
- Added a build-output check in check-tokens.mjs to ensure the token layer is loaded in dist html files.
This commit is contained in:
Marcos Paulo
2026-09-05 19:31:03 +00:00
parent 4b758c765d
commit 64b506aa32
13 changed files with 94 additions and 47 deletions
+3
View File
@@ -10,6 +10,8 @@ const { title, description, lang = 'en' } = Astro.props;
// Self-hosted Manrope and DM Mono. Lives in `public/fonts/` rather than the
// bundled CSS because the legacy stylesheets @import the same file, so there
// is exactly one copy of the faces. See public/fonts/fonts.css.
import tokensStylesheet from '../styles/tokens.css?url';
const fonts = `${import.meta.env.BASE_URL}fonts/fonts.css`.replace('//', '/');
---
@@ -20,6 +22,7 @@ const fonts = `${import.meta.env.BASE_URL}fonts/fonts.css`.replace('//', '/');
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="stylesheet" href={tokensStylesheet} />
<link rel="stylesheet" href={fonts} />
<slot name="styles" />
</head>
-2
View File
@@ -1,2 +0,0 @@
/* Base styles and variables imported */
@import url('./tokens.css');
+4
View File
@@ -11,6 +11,10 @@
--red: #a7483f;
--violet: #6b668f;
/* Fonts */
--font-sans: manrope, arial, sans-serif;
--font-mono: 'DM Mono', monospace;
/* Typography Scale */
--step-display: clamp(56px, 9vw, 126px);
--step-6: clamp(36px, 5vw, 65px);