Traverse DOM
`querySelectorAll` finds every node that contains a `chai-` class after the page is ready.
Introducing Chai Tailwind
Write chai-* classes. The engine scans the DOM,
parses each token, applies inline styles, and re-renders
responsive states as the viewport changes.
<div class="chai-bg-red chai-text-white chai-text-center chai-p-2">
Hello ChaiCSS
</div>
bg-red background-color: red
text-center text-align: center
p-2 padding: 2px
`querySelectorAll` finds every node that contains a `chai-` class after the page is ready.
Spacing, colors, typography, borders, layout, effects, hover, and breakpoints are handled by separate parser functions.
The final declarations are applied with `setProperty`, then updated again for hover and breakpoint state.
Live interface demo
Generated preview
Responsive layout
The same class parser supports breakpoint prefixes and reapplies inline styles when the viewport changes.
Hover state
Hover utilities are handled with JavaScript event listeners, not prewritten utility CSS.
Spacingchai-p-24, chai-mx-auto
Colorschai-bg-red, chai-text-white
Typographychai-text-xl, chai-font-bold
Borderschai-border, chai-rounded-xl
Layoutchai-grid, chai-gap-18
Stateschai-hover-bg-cyan