Content pfp
Content
@
0 reply
0 recast
0 reaction

Darryl Yeo đŸ› ïž pfp
Darryl Yeo đŸ› ïž
@darrylyeo
Increasingly convinced `data-*` attributes (and nested `~=` rules for variants) are the best way to define style primitives in CSS.
5 replies
0 recast
18 reactions

Darryl Yeo đŸ› ïž pfp
Darryl Yeo đŸ› ïž
@darrylyeo
Classes are too loose and it's too easy to get stuck with combinations of them that don't make sense (especially with one-property-per-class systems like Tailwind). Data attributes come with a namespace, and you can omit the value in the vast majority of cases if you define good defaults.
1 reply
0 recast
2 reactions

Darryl Yeo đŸ› ïž pfp
Darryl Yeo đŸ› ïž
@darrylyeo
Been trying this system on /walletbeat and a few other projects and so far it scales really well for me. https://github.com/walletbeat/walletbeat/blob/beta/src/global.css
0 reply
0 recast
3 reactions