This project uses a token-based, modular CSS architecture to maintain consistency and prevent future styling conflicts.
src/assets/styles/
├── tokens.css # Design tokens (colors, typography, spacing)
├── typography.css # All typography rules
├── components/
│ ├── header.css # Navigation & header
│ ├── footer.css # Footer
│ └── layout.css # Grid, containers, blog layout
├── projects/
│ └── footnotes.css # Footnotes project overrides
└── index.css # Main import file
All design values are defined once in tokens.css as CSS custom properties:
:root {
--font-size-body: 1.2rem;
--color-accent-burgundy: #8B4049;
--spacing-lg: 2rem;
}
All text styling is unified in typography.css. Body text elements automatically inherit consistent sizing:
.body-text,
.page-wrapper,
.post-body,
.post-excerpt,
.project-description {
font-size: var(--font-size-body); /* Always 1.2rem */
}
This prevents the issue we had where project pages had different mobile font sizes.
Each major UI component has its own file:
components/header.csscomponents/footer.csscomponents/layout.cssProject-specific CSS files (projects/*.css) should only contain true customizations, not redefinitions:
/* ✅ GOOD - Only unique styling */
.project-cta {
background: var(--color-accent-beige);
}
/* ❌ BAD - Redefining shared styles */
.project-description {
font-size: 1.2rem; /* This is already in typography.css */
}
Update token in tokens.css:
--font-size-body: 1.3rem; /* Was 1.2rem */
Change automatically applies to:
Add to tokens.css:
--color-accent-purple: #8B4499;
Use anywhere:
.my-element {
color: var(--color-accent-purple);
}
Create file in components/:
/* components/sidebar.css */
.sidebar {
width: var(--sidebar-width);
padding: var(--spacing-lg);
}
Import in index.css:
@import './components/sidebar.css';
Responsive breakpoints are managed in the component where they're needed:
typography.csscomponents/header.csscomponents/layout.css✅ Consistency: Change --font-size-body once, updates everywhere
✅ Maintainability: Easy to find where styles are defined
✅ No Drift: Typography automatically consistent across all pages
✅ Clear Overrides: Project CSS only contains actual customizations
✅ Better Organization: Logical separation of concerns
The old monolithic index.css has been backed up to index.css.backup.
tokens.csstypography.cssindex.css with import-based structuretokens.csstypography.csscomponents/header.csscomponents/footer.csscomponents/layout.cssprojects/*.cssprojects/myproject.cssindex.css:@import './projects/myproject.css';
If you're unsure where a style should go, follow this decision tree:
tokens.csstypography.csscomponents/header.csscomponents/footer.csscomponents/layout.cssprojects/*.css