r/css • u/vinishkapoor • 8d ago
AI Assisted Eight visual themes on the same markup, done entirely with CSS variables
Enable HLS to view with audio, or disable this notification
I've been building VinUI, an open-source component library. The main idea is that switching the whole look of a site should only mean swapping CSS variables.
It has eight styles: Precision, Tactile, Clay, Tonal, Editorial, Terminal, Paper and Bento. Every component keeps the same HTML and class names across all of them. Each style is just a set of custom properties, and accent colour, radius, font and density are variables on top. So one button can go from flat and minimal to soft clay-like depth to a monospace terminal look without changing a single tag.
Other CSS details:
- Ships its own small CSS files, so it can sit alongside Tailwind or your own styles
- Charts are plain SVG
- Each component checked against WCAG 2.2 AA contrast in all eight styles, in light and dark
Repo: https://github.com/devvinish/vin-ui
Docs and live style switcher: https://vinish.dev/ui
2
u/osmium_2259 7d ago
Cool idea!
2
u/wingzinco 7d ago
This just makes sense. Reminds me of a more robust CSS Zen Garden, for those that remember.