git clone https://github.com/eshlox/termcss.git
cd term.css
pnpm install
pnpm buildOpen packages/termcss/test/index.html in a browser to see the visual test page.
packages/termcss/ # CSS library (published to npm)
src/
term.css # Entry point (imports all modules)
font.css # JetBrains Mono web font declarations
reset.css # Targeted CSS reset
base.css # Classless element styles
components.css # Optional .t- prefixed components
syntax.css # Syntax highlighting token mapping
accessibility.css # Focus rings, skip link, reduced motion
scrollbar.css # Custom scrollbar styles
print.css # Print stylesheet
themes/ # Theme files (variable overrides)
scripts/
build-css.js # Bundles src → dist via Lightning CSS
build-themes.js # Builds all theme files
generate-theme.js # CLI theme generator
generate-popular-themes.js # Regenerates all bundled themes
test/ # Visual test page
apps/docs/ # Astro documentation site
scripts/ # Root-level monorepo scripts
check-consistency.mjs # Validates themes, classes, README sync
| Command | Description |
|---|---|
pnpm build |
Build CSS + themes + docs |
pnpm build:css |
Build only main CSS |
pnpm build:themes |
Build only theme files |
pnpm dev |
Start Astro docs dev server |
pnpm check |
Run consistency checks (themes, classes, README) |
- Generate a starting point:
node packages/termcss/scripts/generate-theme.js --hue <0-360> --name <name>-
The generator creates
./<name>.cssin the current directory (use--outfor a custom path) withlight-dark()values for both modes. -
The generator validates WCAG AA contrast ratios. If any fail, it exits with an error - fix the lightness values until all pass.
-
Test your theme by opening
packages/termcss/test/index.htmland adding a<link>to your theme file.
- Colors: Always use OKLCH (
oklch(L C H)) - Variables: Use
--t-prefix for theme variables - Classes: Use
t-prefix for component classes - No JavaScript: The CSS framework itself must be JS-free
- Classless first: New elements should work without classes
- Selectors: Prefer element selectors over classes when possible
- Fork the repo and create a branch
- Make your changes
- Run
pnpm buildto verify the build succeeds - Open
packages/termcss/test/index.htmland verify visually - For themes: ensure all contrast ratios pass
- Submit a PR with a clear description of what changed
All text must meet WCAG 2.1 AA:
| Pair | Minimum |
|---|---|
| fg / bg | 4.5:1 |
| muted / bg | 4.5:1 |
| accent / bg | 4.5:1 |
| red / bg | 4.5:1 |
| yellow / bg | 4.5:1 |
| green / bg | 4.5:1 |