Lea Verou, PhD on Nostr: #webcomponents API design dilemma: consistency with the platform or ergonomics? HTML ...
#webcomponents API design dilemma: consistency with the platform or ergonomics?
HTML uses concatenatedcase for attributes¹ which is *terrible* for readability². But if you choose to do something different in your components they will end up with a mix of both since native attributes still apply, which also sucks.
What to do?
¹
https://w3.org/TR/design-principles/#casing-rules² Especially as we start having 4 word attributes like shadowrootreferencetarget 🤮
Published at
2024-12-03 05:02:10 UTCEvent JSON
{
"id": "c25856e8aaf9477a7f6d530ee7ddc3e56045b4d0cc2682640ac4b5cfa9605c14",
"pubkey": "deb27057e60b8d796302849309a7c542aa1c718108be4813086deaf9139dff76",
"created_at": 1733202130,
"kind": 1,
"tags": [
[
"t",
"webcomponents"
],
[
"proxy",
"https://front-end.social/users/leaverou/statuses/113587134850937881",
"activitypub"
]
],
"content": "#webcomponents API design dilemma: consistency with the platform or ergonomics?\n\nHTML uses concatenatedcase for attributes¹ which is *terrible* for readability². But if you choose to do something different in your components they will end up with a mix of both since native attributes still apply, which also sucks.\n\nWhat to do?\n\n¹ https://w3.org/TR/design-principles/#casing-rules\n² Especially as we start having 4 word attributes like shadowrootreferencetarget 🤮",
"sig": "b35d8ad51b318f115e5aa7e48f96650a3d49aebf66508a5dd199300e2e76fd72cc63477d64a66710ddec7923819f1bb10c6a1b322d389b0d4743052520b53a53"
}