Scott Jehl on Nostr: A nice series of replies today has led me to feel comfortable about recommending the ...
A nice series of replies today has led me to feel comfortable about recommending the data- prefix for any custom attributes you use on custom elements (web components).
3 nice reasons:
1) no chance of future collisions with standards,
2) clarity that the attribute is not for standard HTML behavior
3) built-in property/attribute syncing for getting and setting with myElement.dataset is really convenient.
Published at
2024-06-26 15:34:38Event JSON
{
"id": "0a6a9d4c00237dc4bdff970b3321ccfea51ca49ea1e2d6292095c5186d33c426",
"pubkey": "8c72fb5d06a6a4442d62df9f481ff1f791e928589f247cf8932aaf42e0b6cdf2",
"created_at": 1719416078,
"kind": 1,
"tags": [
[
"proxy",
"https://mstdn.social/@scottjehl/112683652121687059",
"web"
],
[
"proxy",
"https://mstdn.social/users/scottjehl/statuses/112683652121687059",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mstdn.social/users/scottjehl/statuses/112683652121687059",
"pink.momostr"
],
[
"expiration",
"1722030775"
]
],
"content": "A nice series of replies today has led me to feel comfortable about recommending the data- prefix for any custom attributes you use on custom elements (web components). \n3 nice reasons: \n1) no chance of future collisions with standards, \n2) clarity that the attribute is not for standard HTML behavior\n3) built-in property/attribute syncing for getting and setting with myElement.dataset is really convenient.",
"sig": "90f6709a48213c51e3af8c94e7e07669b401b9b587729ddef1ba4f0df2eff6c38e1d0accd01aa73e1a2e16146564a7f56080ad67d21ecf4f60385f76cdd91874"
}