Hacker News new | ask | show | jobs
by lenkite 19 days ago
Regarding puzzling design choices, I am wondering at the preponderance of data attributes like

   <e-toast
    data-type="success"
    data-position="top-right"
    data-hide-after-n-seconds="5"
    data-close-icon="/images/close.svg"></e-toast>

For custom web components, maybe the author forgot that you don't need to prefix attributes with data ?
1 comments

You don't need it anywhere, unless you want to use dataset property.
All custom attributes must start with data, read the convention
The browsers disagree.