siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
175 stars 62 forks source link

iX custom properties can not be set within a Shadow DOM (selector: `:root .<theme-class>`) #1009

Open mjsrocha opened 6 months ago

mjsrocha commented 6 months ago

What happened?

When an iX component is loaded as a micro-frontend (aka remote) in a Shadow DOM within a non-iX container web app, iX's css custom properties can't be set by the iX-based micro-frontend. Therefore, the styling of the iX micro-frontend is broken!

A deep investigation of the issue brought to light the following findings:

Therefore I suggest that iX provides a css file that defines custom properties in such a way that they can be used by micro-frontends in a Shadow DOM within a non-iX app. The selector for the custom properties could be extended, e.g.: :root .<theme-class> -> :root .<theme-class>, :host <.theme-class>. Alternatively a separate css file could be provided for micro-frontends, using :host instead of :root as main selector.

What type of frontend frameware are you seeing the problem on?

Angular, Others

Which version of iX do you use?

v2.0.4

Code to produce this issue.

Internal code repo:

mfe-blueprint

Fixed brand-theme (internal code repo): mfe-blueprint/-/blob/main/projects/mfe3/src/app/tariffs/ix-brand-theme.fixed.scss

Please contact me for more details or internal link to the repo.

danielleroux commented 6 months ago

Please provide an accessible code. Using Stackblitz or a GitHub repository.

Imo avoid linking siemens internal repositories on a public space.