Write CSS in HTML?! Tailwind CSS Arbitrary Properties

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

I read your article on how you made this, and just gotta say it was great. I look forward to you writing (or recording) how you made this in depth.

codybontecou
Автор

I understand more about css because Tailwind

That is why I use Tailwind on every project ~

asheavenst