Write leaf-* class names β
styles get injected automatically.
No compilation. No config files. Just one script tag.
<!-- CDN --> <script src="https://cdn.jsdelivr.net/npm/@chandan632/leaf-css/dist/leaf.min.js"></script> <!-- Use anywhere --> <div class="leaf-flex leaf-p-4 leaf-bg-blue leaf-rounded-lg leaf-text-white"> Hello leaf-css! </div>
Use leaf-bg-* Β·
leaf-text-* Β·
leaf-border-*
Base colors
Light & dark variants
Numeric scales (100β900)
blue
green
red
purple
orange
teal
rose
indigo
gray
slate
zinc
Text styles
Border radius scale
Border styles
Shadows
hover Β· focus Β· active Β· disabled
flex Β· justify-between Β· items-center
grid-cols-3 + gap-4
col-span-2 Β· col-span-full
Responsive: grid-cols-1 β md:2 β lg:4
sm:640 Β· md:768 Β· lg:1024 Β· xl:1280 Β· 2xl:1536
Resize the window β this text changes size
Pass any value directly with
leaf-*-[value] syntax.
leaf-p-[30px] β
padding: 30px
leaf-bg-[#ff6b6b]
β custom hex color
leaf-text-[#9333ea] β custom text color
leaf-w-[320px]
β fixed width
leaf-w-[calc(100%-40px)]
β calc()
Spinners
Pulse Β· Bounce
Scale on hover Β· Rotate on hover
Entrance animations
Linear gradients
Three color (via)
Gradient text
Extend the default palette with your own tokens. Fully optional β defaults work out of the box.
window.__leafConfig = { colors: { primary: '#6366f1', secondary: '#8b5cf6', brand: '#ff6b6b', }, extend: { spacing: { 13: '52px' }, fontSizes: { hero: '72px' }, }, };
Custom colors
Custom font-size: text-hero
Aa
Custom spacing: p-13 β 52px
leaf-p-13 β
a custom spacing token via extend.spacing
Elements added after page load are automatically processed. Works with React, Vue, and any dynamic content.