designsystemsinternational / mechanic

Mechanic is a framework to build assets built on web code.
https://mechanic.design
MIT License
251 stars 11 forks source link

Custom input CSS infiltrates into SVG outputs #129

Open fdoflorenzano opened 2 years ago

fdoflorenzano commented 2 years ago

Describe the bug When custom inputs are used in mechanic project, their CSS also infiltrates into a design function's iframe because of dependencies, and therefore SVG outputs also get injected their CSS. In some cases, that CSS isn't automatically removed. I specifically had this with the ui-components CSS definitions, and had SVG outputs that triple in weight because of these.

A specific setting is introduced (ignoreStyles) in #128 to patch this, but that also ignores the design function's CSS. So currently having only the design function's CSS but not any from custom inputs is a bit tricky.

Expected behavior SVG outputs not to contain custom input's CSS automatically.

Desktop (please complete the following information):