3 ms·
I don’t like the proposed method but I’m glad to see thoughts a little outside the main lines of utility CSS vs Module isolation vs naming conventions like BEM.
by hnthrowaway121 2y ago
I don’t like the proposed method but I’m glad to see thoughts a little outside the main lines of utility CSS vs Module isolation vs naming conventions like BEM.
One bad consequence of the custom element name convention is that the outer layer of a component then has no semantic meaning and accessibility has to be fully implemented by the developer, which requires a lot of knowledge and effort compared to using correct semantic HTML.
Inaccessible code is a real business risk and making all components generic elements with no affordances for screen readers would not help. It’s a pity the article doesn’t consider this at all as its recommended patterns would lead to some needlessly bad experiences.
- rasso 2y agoYou can tell custom elements what they are using the „is“ attribute or by extending the appropriate HTMLElement class if you define the custom element via JS.
- hnthrowaway121 2y agoThat seems like quite a hoop/footgun if you are only having devs do this for CSS reasons.