Post

Btw Adam if you're running into styling issues using optgroup it's almost definitely a bug. We specifically allowed legend as the first child of optgroup so you could do rich content in it.

So I think the styling story is using legend because then you can select it in CSS, I think just the label attribute on optgroup does remain less styleable. Though including it is better for older (and non chromium) browsers.

Niiice! Fwiw, you can avoid the text repetition by using attr(label) to save the text to a custom property, then use CSS content on a pseudo to output it.

0 reposts6 likes

No replies yet.