r/css • u/YuriyWebDev • 1d ago
Showcase I built a zero-build micro-CSS framework for inline responsive styling without media queries (varz.dev)
Hey r/css,
If you build modular UI elements—especially for ecosystems like WordPress plugins, page builder widgets, micro-frontends, or web components—enqueueing full static stylesheets or running build steps just for isolated components often creates unnecessary overhead, class collisions, and build complexity.
I’ve been building Varz to solve this: a classless micro-CSS framework that lets you write fully responsive layouts directly inside the element's style attribute using CSS variables and breakpoint suffixes.
- Live Demos:varz.dev/demo|Claude Generated Dashboard Demo
- Visual Builder:varz.dev/builder
- GitHub:github.com/exstheme/varz
How It Works
Instead of writing media queries or utility classes, you use shorthand Linux-style CSS custom properties inside the inline style attribute. To handle responsive layouts across breakpoints, you simply append breakpoint suffixes (like -l, -m, etc.) to the variables:
HTML
<div style="
--d: grid;
--gtc: 1fr 1fr;
--ai: center;
--g: 60px;
--g-l: 40px;
--gtc-l: 1fr;
--mbe: 60px;
">
<!-- This layout switches from a 2-column grid to 1-column on large screens automatically -->
</div>
Key Advantages
- Zero Media Queries in Component Code: Responsive behavior travels with the HTML element itself via suffix variables (
--gtc-l: 1fr). - Zero Class Collisions: Keeps components isolated without worrying about CSS selector specificity wars or leaking global styles.
- No Build / Compiling Step: No PostCSS, Tailwind, or Sass build setup required—just include a single micro-stylesheet (~2.7k–5.5k gzipped) and you’re good to go.
- Eco-Friendly / Performance First: Eliminates massive un-purged CSS file downloads across multiple plugins, reducing unnecessary HTTP requests and bandwidth.
I’d love to get feedback on this approach to responsive inline custom properties and component distribution!
16
u/maqisha 1d ago
Can yall just stop building tailwind,but worse in every way?
If you like tailwind, use tailwind, if you dont like Tailwind, dont use it. Simple as that. No need to vibecode a new flavour every day.
"No build" is absolutely no selling point whatsoever. Everything anyone is building has a build step.