patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
375 stars 85 forks source link

[1:1]: pfe-icon #2106

Closed bennypowers closed 1 year ago

bennypowers commented 1 year ago

Component name: <pfe-icon>

Design specification updates

PatternFly v4 Icon

I'd like to change the public apis here somewhat, removing the iconset prefix from icon names and instead adding an optional set attribute, which falls back to the default icon set.

<blink>OLD:</blink>
<pfe-icon icon="fa-alert"></pfe-icon>
<pfe-icon icon="fas-warning"></pfe-icon>

<marquee>NEW:</marquee>
<pfe-icon icon="alert"></pfe-icon>
<pfe-icon icon="warning" set="fas"></pfe-icon>

Under the hood, I'd like to maintain the lazy-loaded icons approach from v1, but instead of pointing icon sets to a URL template and fetching in the SVG contents to display, I'd like to ship the default icon sets as lit TemplateResult objects in conventionally named modules, in the pfe-icon package. These modules would be gitignored and generated at build time, similar to how PF-react does it. At runtime, those modules would be dynamically import()ed. Like v1, we would provide imperative escape hatches to register icon sets as import specifier templates, which would be relative, absolute, or fully qualified URLs. cc @mwcz @kylebuch8

bennypowers commented 1 year ago

pfe-icon will default to fontawesome, but will ship with redhat brand icons.

cc @markcaron