seb-oss / green

Green is an open-source design system built by SEB.
https://storybook.seb.io/
Apache License 2.0
31 stars 43 forks source link

Icons should have gds-element attribute #1405

Closed vsjolander closed 1 month ago

vsjolander commented 1 month ago

Icons does not have the gds-element attribute which makes it hard to query for the element when scoping is applies.

Current element in DOM: <gds-icon-archive></gds-icon-archive>

Element with attribute: <gds-icon-archive gds-element="gds-icon-archive"></gds-icon-archive>

Not sure if it should have some general attribute for icons aswell making it easy do query for all icons on page? 🤔

splashdust commented 1 month ago

I think the gds-element should be enough, as you can use attribute prefix selection to do a general query for icon: [gds-element^="gds-icon"] And when dealing with DOM you can just check if its a sub-class of GdsIcon