Theme System (colors) from hue and chroma (OKLCH)
npm install saryantsTheme System (colors only) from hue and chroma (OKLCH). Part of ThamanyanLS · SaryanTS · ParajanovCS · Dodo.
- ThamanyanLS — Layout System (depth-based sizes)
- SaryanTS — Theme System (colors)
- ParajanovCS — Component System (consumes both)
CDN (single script) — injects CSS + theme API:
`` Themed texthtml`
Classic — CSS + optional theme script:
`html`
- Hue + chroma only: Set --hue (0–360) and --chroma (0–0.4); all semantic colors are derived in CSS.data-theme="light"
- OKLCH: Perceptually even colors.
- Light / dark: or data-theme="dark" on (default: dark).
- Colors only: No components, no spacing, no radius — use with ThamanyanLS (sizes) and ParajanovCS (components).
SaryanTS exposes:
| Variable | Usage |
|---------|-------|
| --bg, --bg-light, --bg-dark | Backgrounds |--text
| , --text-muted | Text |--primary
| , --secondary | Actions |--danger
| , --warning, --success, --info | Semantic |--border
| , --border-muted | Borders |--highlight
| | Highlight |--glass-bg
| , --glass-border | Glass effects |
If you load the theme script, SaryanTSTheme is available:
- SaryanTSTheme.hue = 200 — set hue (0–360)SaryanTSTheme.chroma = 0.2
- — set chroma (0–1)SaryanTSTheme.theme = 'light'
- or 'dark'SaryanTSTheme.toggleTheme()
- — switch light/darkSaryanTSTheme.restore()
- — restore from localStorage (called on load)
`bash`
npm install
npm run build # Build CSS + theme JS
npm run dev # Build and serve demo
npm run preview # Preview production build
- dist/saryants.min.css — CSS bundle (tokens + themes)dist/saryants-theme.min.js
- — theme scriptdist/saryants.min.js
- — CDN bundle (CSS + theme)
- OKLCH: Chrome 111+, Safari 15.4+, Firefox 113+
- CSS mod()`: Chrome 118+, Safari 17.2+, Firefox 128+
MIT.