Better foundations
Ready-made shadcn-style and Tailwind components for semantic, legible interfaces. Built for the Supertype workflow and released as open source.
Install
Install it with three commands: add the package, initialize the CSS, and run the wiring check.
After a version bump, npx foundations upgrade moves the code the release changed. Upgrading lists what each release changes.
Every release is tagged and published, so you can pin a specific commit ahead of the next release.
Here is what init writes. This site uses the same block, unchanged:
Do not skip the @source line
node_modules by default. Leave this line out and the package’s utility classes get purged from the build. The components render bare, with no error.Fonts are the one part you wire up yourself. next/font runs in your app and hashes its variable names at build time, so the binding belongs in your layout:
Designed with intention and mathematical rigor.
Typography primitives, semantic tokens, the essay shell, and contrast checks in one package, enforced in CI.
Decisions live in one place
Utility classes are for styling. The actual decision belongs in the design system. Every type style, tone, and divider on this page comes from one package, so a change is one diff instead of a search through the app.
Every colour is measured twice
WCAG tells us whether a colour passes the audit. APCA's Lc tells us how it feels in context, since the same contrast can read differently on different backgrounds. Both checks run against the shipped stylesheet in light and dark mode, so CI catches anything that slips.
If you use a coding agent
The package ships an llms.txt alongside its dist/: the public API, the rules, and the common mistakes that tend to sneak into a build. One line is enough to point an agent at it, so it stops generating text-sm text-muted-foreground when a primitive already exists.
Coding agents covers what is in the file, how it stays current, and the lint rules and doctor run that catch what it misses.
Legibility with mathematical rigor
WCAG is good for compliance. If you swap the ink and the ground, the number stays the same, but on screen the feeling changes: dark letters on a bright field can look thinner, and light letters on a dark field can feel heavier. The two samples below carry the same ratio to a tenth, both pass AA, and still read a little apart.
Six weeks after the migration the queue drained on its own, which nobody had predicted and nobody could explain.
Six weeks after the migration the queue drained on its own, which nobody had predicted and nobody could explain.
The package measures its palette twice. contrast answers the compliance question, and lc answers the design one: whether your secondary ink is meaningfully quieter than your primary, and whether it still feels that way in dark mode. Both read the resolved cascade, so what gets measured is the page a browser actually paints.
- WCAG ratio, tertiary ink
The dark theme measures nearly twice the light one.
- Lc, the same two inks
Polarity-aware, so it ranks them the other way.
- Floors held in CI
Both themes, every release.
Light
Dark
Light
Dark
Read
Marks
checkLegibility and checkSignals hold those floors across both themes in CI. Every figure above was computed at build time from the stylesheet this site installs, including the two ratios in that row: the same tertiary ink measures 3.44:1 in light and 6.75:1 in dark, and reads 59.5 Lc against 47.8. Two measures has the maths and the call sites.
What is in here
The written reference lives in the repo: the README and docs.
In production
Sites running the package. Both install it from a tag, the way the instructions above describe, so you are seeing these components at full size on real content.