中文
Back to notes

Why I kept three sites in one repo

Monorepo, override pattern, and the very small number of decisions that make a family of sites feel like one company without forking the design system.

The monorepo decision was not ideological. It was the answer to one specific question: how do I make the corporate site, the lab, and the personal site look like they belong together without copy-pasting the design tokens into three places that would inevitably drift?

The naive answer is a single CSS file imported by all three. The problem with that is each site has a different voice. The corporate site needs to look like a UK limited company. The lab needs to look like a marketplace. The personal site needs to look like a person. You cannot serve all three with one accent color.

The fix is the override pattern. The shared package defines every token. Each site has a small override.css that re-declares the tokens that need to change. The shared components read tokens, not hardcoded colors, so they re-skin themselves. The result is a single source of truth for the family DNA, and three sites that each have their own accent, their own radius, their own mood.

The trick that makes it work: a component that hardcodes a color is not eligible for the shared package. A component that reads from a token is. The hard constraint catches the things that would otherwise leak into three slightly different shades of green.

Comments

Comments are powered by GitHub Discussions. Sign in with GitHub to leave one.

More in this category

← Previous Building a chronograph for the year you were born Next → Glassmorphism is just a backdrop-filter