3 ms·
Using data- which is the niche made for this in the standard, seems to be the solution that's more likely to still work 15 years down the line.
by kzrdude 6y ago
Using data- which is the niche made for this in the standard, seems to be the solution that's more likely to still work 15 years down the line.
- recursivedoubts 6y agofine by me
- wongarsu 6y agoThe only real practical concern is that if you don't use data- you might use an attribute that will become meaningful to future browsers. But what are the chances of html gaining an attribute that starts with hx-?
- err4nt 6y agoWhen you camp on the platform namespace it ties the hands of standards bodies - we will not get <modal> in HTML for real because too many people already went ahead and did it. Same for <accordion>, etc. Look up 'Smooshgate' for a similar example in JavaScript. Our workflows should have us practice writing _valid_ code, which our tools can then take and transform into other _valid_ code. Any workflow where the humans practice doing the _invalid_ thing so the tool can magically fix it later is a bad idea IMO. Practice writing good code and use tools to make it even better!