News for hackers. Stuff that matters.
Re:TailwindCSS JIT with arbitrary values by Swizec on Wednesday April 07, 2021 @05:27PM (#26731584)
> There’s something huge to be said about the fact that I don’t need to context switch to CSS-land out of my markup to style up what I’m doing. I didn’t realise it, but that overhead of switching to a style sheet and going back to modify markup and then viewing the results in the browser really just used up my mental energy battery.

Welcome to what us React folk have been saying since at least 2016. Splitting your code by language is bad. Vertical slices for the win.

Re:TailwindCSS JIT with arbitrary values by benatkin on Wednesday April 07, 2021 @06:24PM (#26732256)
Agree. Vue and Svelte get this right as well (assuming you use SFCs properly), except they don't have bizarre preferences for one-way data binding everywhere or typing className instead of class.
Re:TailwindCSS JIT with arbitrary values by runarberg on Wednesday April 07, 2021 @06:32PM (#26732338)
Agree with this. Although I’m gonna say it is not the single file per-se which is the winning technology here but the component scoped styles. When writing vanilla web components this can be accomplished with `this.attachShadow()`, and in Stencil you write an external stylesheet and reference it with a `styleUrl` in your `@Component` decorator.

In fact it is kind of nice to put your styles in another file if you have a designer on your team who is afraid to touch any files that don’t have the `.css` extension.

Re:TailwindCSS JIT with arbitrary values by aabbcc1241 on Wednesday April 07, 2021 @08:46PM (#26733674)
Elm also approaches this way, with type-safe checking.
Re:TailwindCSS JIT with arbitrary values by tiborsaas on Thursday April 08, 2021 @03:57AM (#26736195)
I still dislike CSS in JS solutions and classname soup.

- A fellow React folk.