Overview - Square bracket notation for custom values
What is it?
Square bracket notation in Tailwind CSS lets you write custom values directly inside class names using square brackets. This means you can use any size, color, or spacing value that Tailwind doesn't include by default. It helps you quickly add unique styles without changing configuration files. For example, you can write 'text-[22px]' to set font size to 22 pixels.
Why it matters
Tailwind provides many ready-made classes, but sometimes you need a style that isn't included. Without square bracket notation, you'd have to edit config files or write extra CSS. This notation saves time and keeps your code clean by letting you add custom styles right in your HTML. Without it, styling would be slower and more complicated.
Where it fits
Before learning this, you should know basic Tailwind classes and how utility-first CSS works. After this, you can explore advanced Tailwind features like plugins, theming, and responsive design. This concept is a bridge between using default utilities and customizing styles flexibly.