commercetools / commercetools-docs-kit

Tools and components for developing Documentation websites 🛠
https://docs-kit.commercetools.vercel.app
MIT License
18 stars 5 forks source link

svgr issue with lordicon icons #1791

Open gabriele-ct opened 1 year ago

gabriele-ct commented 1 year ago

As described here there seems to be an issue related to the jsx generation of certain lordicon icons. Some icons are "missing" come vector elements

The purpose of this ticked is to further investigate the issue and potentially come up with a solution

nkuehn commented 1 year ago

here are a couple of svg icons (namely login and document) that get converted to jsx with some vectors missing.

couldn't stop my curiosity. I compared the icons SVG between the tsx and the svg files and there are actual pieces missing (paths, i.e. lines). My guess is that the "svgo" optimizer that svgr uses by default thinks they are invisible.

https://react-svgr.com/docs/options/#svgo

One attempt to fix it could involve moving the lordicon based SVGs into a separate folder and convert them in a separate svgr call that uses the -no-svgo option.