re-com icon indicating copy to clipboard operation
re-com copied to clipboard

Update Icons to Use SVGs

Open superstructor opened this issue 3 years ago • 0 comments

1. Status Quo

Uses Material Design Iconic Font. Implemented as font and CSS files distributed manually that must be made available via HTTP. A [:span] contains a special character code that maps to an icon in the font.

Upsides

  • No breaking changes.
  • No work to complete.
  • Supports old browsers (e.g. Internet Explorer, Android prior to 4.4 etc) although we probably don't care anymore.

Downsides

  • Must be manually deployed as a separate file. Not pulled in automatically with the JAR dependency and :require. Esp bad for upgrade experience or new users expecting the library to "just work".
  • Limited styling compared to SVG, in theory.
  • Limited to icons supported by the Iconic font distribution.
  • At some point upstream will probably stop shipping font files for icon sets, as it is effectively an obsolete technique now with widespread SVG support in browsers.

2. Material Design SVG Icons - Manual

Would use Material Icons as SVG represented as hiccup in reagent view functions.

Upsides

  • Pulled in automatically with JAR dependency and :require. No extra files to deploy.
  • Full CSS styling available, but would we actually use it ?
  • Opens up possibilities of animations and transitions.
  • Can include any SVG, not limited to a pre-packaged font.
  • Supports any relevant browser today (i.e. MS Edge, Chrome, Firefox, Safari etc)

Downsides

  • As the library maintainer, to upgrade or add icons from the upstream SVG icon set would be a manual process.
  • Tree shaking would not be possible or a breaking API change would be required.

3. Material Design SVG Icons - Automated

superstructor avatar Mar 08 '21 02:03 superstructor