Currently in juno we render the styles needed for juno-ui-components and for the microfrontend itself as text into a <style> tag. This leads to duplications if multiple microfrontends are loaded on the same page (each in its own ShadowRoot, each one will include the same style block from juno-ui-components. We had tried to use constructed stylesheets in the past but the spec states:
Currently in juno we render the styles needed for
juno-ui-components
and for the microfrontend itself as text into a<style>
tag. This leads to duplications if multiple microfrontends are loaded on the same page (each in its ownShadowRoot
, each one will include the same style block fromjuno-ui-components
. We had tried to use constructed stylesheets in the past but the spec states:This made them not usable for us since we want the styles of the components in our component library to be overrideable by users. See also here: https://github.com/cloudoperators/juno/blob/main/libs/juno-ui-components/src/components/ShadowRoot/ShadowRoot.component.js#L19-L23