10 ms·
The difference is you type that lingo inline into the HTML instead of in separate files and you don't have to come up with any class names.
by dcre 5y ago
The difference is you type that lingo inline into the HTML instead of in separate files and you don't have to come up with any class names.
- animal_spirits 5y agoComing up with variable/class names is one of the most annoying aspects of programming, so any way we can eliminate that task I think is always going to be a productivity boom
- seph-reed 5y agoSo strange. Using good variable names is even better than docs in my experience. And having HTML where every div is named helps a ton. It blows my mind how different people's preferences can be on these things.
- cwaffles 5y agoMemorizing and looking up names has significant impact on my productivity, especially on codebases that I do not touch frequently. I often losing my train of thought or momentum because of too much abstraction
- d3ckard 5y agoMost people suck at naming things. Also, most companies don’t have a strong culture for choosing names carefully. Honestly, I agree with you on the good variable names, but in average team setting I prefer no names than bad ones.
- jeremyjh 5y agoYes, communicating intent to other programmers and our future selves is hard, so let's not do it.
- iovrthoughtthis 5y agowell, sometimes. yes. the semantics of most html elements is useless to know for more devs (and classes don't help users) in fact a class like .red conveys more useful information to a developer than .standout-link because when we go to change the colour of the button it's the colour we care about, not the "purpose" of the button
- tlamponi 5y agoSounds a bit like a glorified <el style="display:flex;justify-content: start;">... ?
- moritzwarhier 5y agoThe differences are: * media queries * @apply * low specificity (tailwind doesn't do !important) EDIT: It "does" important, but only when instructed so, in 1.x it was a global switch, apparently since 2.x its available as a per-class modifier. Thanks dcre * the theming abstraction * brevity
- dcre 5y agoTailwind does have important, it was added with JIT. https://tailwindcss.com/docs/just-in-time-mode#built-in-important-modifier https://tailwindcss.com/docs/just-in-time-mode#built-in-impo...
- aidos 5y agoOh, nice, I think that’s a new 3.0 thing, not a JIT thing.
- dcre 5y agoLooks like TW 2.2 from June. It wasn't in the initial JIT release in 2.1. https://github.com/tailwindlabs/tailwindcss/releases/tag/v2.2.0 https://github.com/tailwindlabs/tailwindcss/releases/tag/v2....
- aidos 5y agoI’m…not sure how I missed that, because I did look for it. Thanks for the heads up!
- deleted 5y ago[deleted]
- 5y ago
- marstall 5y agothat gets long - especially if they are rendered inline, hard to scan through. I'm often in a cycle where I am tweaking a complex class with 10-20 properties including flex, transforms, animations, etc. - and having them each be on their own line (and the class being in a separate file along with its parents, siblings and children, frankly) is key for readability to me. I guess in the end I have come to have enormous respect for CSS as a powerful, mature language and I'm not looking to be buffered from it.
- dcre 5y agoI don't think of it as an alternative to CSS. I think of it as a way of writing CSS. It can get long. I certainly have parts of my app where I break out into plain CSS because it's easier to understand.
- docmars 5y agoI put most of my Tailwind utilities on their own line in my HTML, and for elements that need more than 3 or 5, I do the same but in classes or styled components where I'm listing them off instead. Keeps everything clean and readable!
- agumonkey 5y agoFor toying / prototyping it's way nicer than I'd ever expect. Seriously fun. I now inject tailwing anywhere possible.
- bamboozled 5y agoThis, I've used it only for about a week, there's no way I could go back now.
- matijs 5y agoYou’re not wrong. Once it’s in there, it’s not easy to remove/replace again.
- matijs 5y agoThose files (and components) still need sensible names (that would make very nice class names).