Update Icons; added aliases
I updated three aspects of our current icon setup:
-
Aliases: Icons can now have aliases: in place of an
IconConfig
you can now also add anIconAlias
; e.g.{ name: 'back', from 'chevron', transform: 'rotate(90deg)}
. From there on you can use 'back' as an icon name and it will show a rotated chevron icon. Also aliases are chainable ^^ - Dependency Injection: Icons are now initially provided through dependency injection. Before, we used a Module whose constructor added the items to the service directly. The module constructor alas can get called multiple times (happens with modals and standalone components – I suspect, also lazy loading - meh) adding the icons all over again.
- No Shadow DOM: The rcc-icon component no longer uses shadow dom. I used that before to keep up encapsulation while still manually adding the svg. (Sadly that does not work with standard encapsulation.) But that caused all(!) the styles to be added to every icon's shadowroot element. So I removed encapsulation completely, which on top of everything makes it a lot easier to manipulate the svg with css :D