> I’ve written a few thousand words on why traditional “semantic class names” are the reason CSS is hard to maintain
So don’t use semantic class names! Use custom elements. app-card. image-viewer. Use HTML attributes for behavior
<custom-modal size=“large” open>…</custom-modal>
then simply write:
custom-modal[size=“large”] { … }
Use CSS variables as design tokens for site-wide theming. Shadow DOM yes/no? Up to you!
Tailwind is a really interesting idea…for the era prior to the one we’re in now!
Can you count how many <div> tags are in this basic example? 14 I think?
This isn’t how you HTML, people! Write markup that *actually describes in plain language what the structure of your document is*.
Sorry, I know there are a LOT of Tailwind fans out there and you’ll probably unfollow me now. That’s fine. I don’t have too many programming hills to die on, but taking full advantage of the glory that is HTML5 is one of them. Tailwind is…the opposite of that! 😭
OK OK, I’ll stop now 😜
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Spent a few hours researching @polymer LitElement today. It's been on my todo list for ages.
This is a REVELATION.
It takes *everything* that's great about Web Components, and makes them 10 times better.
Essentially, for most things most of time,
You. Don’t. Need. React. !!!
The hydration story is also *really* interesting. You can ingest plain ol’ HTML markup including data from child nodes or element attributes (even JSON data) from a static site generator…
…and then sprinkle in ALL the interactive bits you need.
This is truly the future.
Performance is outstanding. All the dynamic prop re-renders work exactly as you'd expect, with only the little bits that need to change actually changing—even when passing brand-new array props. This is some *wild* voodoo.