5 ms·
Would be interesting though to opt in to those behaviors. So something like <MySemanticLabel label> </MySemanticLabel> Then you could mix and match functi
by tenaciousDaniel 7y ago
Would be interesting though to opt in to those behaviors. So something like
<MySemanticLabel label>
</MySemanticLabel>
Then you could mix and match functionalities. So if you have a list of labels, you could do the following:
<LabelList>
<LabelItem label listItem>
</LabelItem>
</LabelList>
- Touche 7y agoYou do opt into them, by using label. if you want an element with no behavior, that's what div and span are for.
- tenaciousDaniel 7y agoRight, but this offers two benefits: (1) semantic naming, and (2) composed functionality. So for example, if you wanted an element that exposes label behavior and list-item behavior, you could do that. With html, you have to use 2 elements: <li> <label> </li>
- Touche 7y agoYes, this is a major flaw of HTML, it is very specific about where certain elements can and cannot be, so you can't really even design a solution like the above.