3 ms·
Yes, or now with Tailwind v3.0 you can write that as <el class="[display: flex] [justify-content: start]">... I wish I were being hyperbolic, but alas, no
by montroser 5y ago
Yes, or now with Tailwind v3.0 you can write that as
<el class="[display: flex] [justify-content: start]">...
I wish I were being hyperbolic, but alas, no: https://tailwindcss.com/blog/tailwindcss-v3#arbitrary-properties https://tailwindcss.com/blog/tailwindcss-v3#arbitrary-proper...
- keyle 5y agoExcuse my dad joke "There is a lot of wind at the end of that tail"!
- drusepth 5y agoTo be fair, one of the big perks of Tailwind (IMO) is not having to have a big ol' folder of CSS that you have to figure out what applies where in HTML, but rather just having all your styling inline (while still staying consistent, which is the usual downside of inlining styles manually). Having to have a tailwind-addons.css when you needed random bits of CSS they didn't have classes for kind of sucked; this looks like a nice QOL that would get me back to the original goal of uniting structure-and-style into singular files. FWIW, I also hated using header files in C++ and also wrote a Ruby library for inlining all my tests immediately following the functions they test. I like having more context when looking at code without having to flip around from file to file to piece a bigger picture together.
- docmars 5y agoThe same reason Vue introduced single-file components! If you haven't tried Vue yet, I strongly recommend it based on what you said.
- drusepth 5y agoThanks for the recommendation! I've mostly been thrust into React, which works for what I need but I definitely don't enjoy it. I'll give Vue a shot!
- akvadrako 5y agoSvelte also has single file components. It seems the biggest advantage most people find in tailwind is working around a react limitation.
- docmars 5y agoThis seems silly, but even this has benefits over online styles: it generates a scoped classname that wouldn't interfere with others, and you can use this syntax with JS conditionals to dynamically apply CSS with values interpolated if you need. Not much different than injecting an object in a `style` attribute in practice, but there's a lot of creative firepower in the arbitrary styles API.
- docmars 5y agoToo late to edit, but not "online" styles—but "inline" xD