filmov
tv
Write CSS in HTML?! Tailwind CSS Arbitrary Properties
Показать описание
Arbitrary values in Tailwind CSS let you define a custom **value** for a given CSS concern. But that superpower can be extended to define… abritrary properties as well!
Want to use some CSS property which is not supported by Tailwind?
Of course, you could **“just write CSS”** in a CSS file, but if you enjoy writing your CSS from your HTML directly, you can open up square brackets in your class attribute, and here write any CSS key-value pair you want.
The only gotcha is you need to replace spaces with underscores, since a CSS class cannot have spaces.
Yeah, those are ***just like inline styles.***
But they will work with responsive modifiers, state modifiers, feature queries and everything else!
That’s…. pretty cool! #shorts
Want to use some CSS property which is not supported by Tailwind?
Of course, you could **“just write CSS”** in a CSS file, but if you enjoy writing your CSS from your HTML directly, you can open up square brackets in your class attribute, and here write any CSS key-value pair you want.
The only gotcha is you need to replace spaces with underscores, since a CSS class cannot have spaces.
Yeah, those are ***just like inline styles.***
But they will work with responsive modifiers, state modifiers, feature queries and everything else!
That’s…. pretty cool! #shorts
Комментарии