3 ms·
I never suggested decoupling html and CSS, that is always going to be coupled through selectors. What I suggested was decoupling presentation (actual CSS rules
by fjfuvucucuc 3y ago
I never suggested decoupling html and CSS, that is always going to be coupled through selectors.
What I suggested was decoupling presentation (actual CSS rules) from structure, the blocks of html.
What I'm discussing here is if CSS rules should be inlined in html, whether through tailwind pseudo css or style tags the result is the same.
Further caveat, the article mentions that switching to a CSS file is a context switch. Put it in a style tags next to your html for all I care, colocation is great as a general rule, inlining CSS in html style attributes is not.
This is settled thinking at this point: inlining CSS results in short term benefits to productivity at the cost of long term costs due to brittle presentation that is expensive to change.
And given how low the cost of extracting reusable css classes is these days, I don't think tailwind will ever win.