# "Theming: Web Components" _Path: en/frontend/micro-frontends/web-component-theming_ > "Theming reference covers the full CSS variable catalog. This doc covers how a web component receives the theme through shadow DOM." ## Table of Contents - Theming: Web Components ## Content # Theming: Web Components [Theming reference](./theming.md) covers the full CSS variable catalog. This doc covers how a web component receives the theme through shadow DOM. --- ## How the theme reaches your component Shadow DOM blocks CSS cascade — stylesheets written outside your component do not apply inside it. However, CSS custom properties (variables) **do** cross the shadow boundary. This means: - Custom properties inherit across the shadow boundary. WippyElement also bridges every configured variable name through its forced-theme inner root, so locally loaded `theme-config.css` defaults cannot reset configured values. - PrimeVue component styles, Tailwind utilities, and other rule-based stylesheets do **not** cascade in — you must load them explicitly via `hostCssKeys`. --- ## Customization levels **L1 — Global:** CSS custom properties cross the shadow boundary. WippyElement enumerates the effective global/children/page variable maps, including `@light` / `@dark`, and installs a generic inheritance bridge before the injected custom CSS layer. **L2 — Scoped:** Same as L1 for custom properties. Stylesheet-based CSS (PrimeVue, Tailwind) does not cascade — use `hostCssKeys` to load these explicitly into the shadow root. **L3 — Per-page config_overrides:** CSS vars set via operator `config_overrides` reach the WC host and inner theme root through the same generic bridge. **Facade `custom_css` reaches the shadow root (Web Host 1.0.43+, opt-out).** Selector rules do not cascade across the boundary, so the runtime injects composed global + children custom CSS. The configured-variable bridge is independent of the frontend `customCss` opt-out and remains active. Ordering is platform theme defaults → configured-variable inheritance bridge → injected custom CSS. > **Before Web Host 1.0.43**, facade `custom_css` rules did not reach a component's shadow root — only custom properties inherited. On older hosts, replay the rule inside the WC's own styles or lift it to a `--p-*` token form. --- ## Receiving theme CSS JavaScript externalization follows the complete pinned Web Host `import-map.json`, including for `@wippy-fe/theme`. CSS delivery is separate: a shadow root receives rule-based theme assets only through `hostCssKeys` or bundled/inline CSS. ### `hostCssKeys` — runtime CSS loading Declare which host-served CSS assets the WC runtime should inject into your shadow root. Add to `wippyConfig.hostCssKeys`: ```typescript static get wippyConfig(): WippyElementConfig { return { propsSchema: pkg.wippy.props as WippyPropsSchema, hostCssKeys: ['themeConfigUrl', 'iframeCssUrl'] as const, inlineCss: stylesText, } } ``` | Key | What it loads | Size | When to include | |---|---|---|---| | `themeConfigUrl` | `theme-config.css` — the full `--p-*` CSS variable system | ~8 KB | When the WC consumes host semantic tokens, dark mode, or themed chrome. A presentation-neutral canvas/SVG/chart can omit it. | | `primeVueCssUrl` | All PrimeVue component CSS (unstyled mode) | ~455 KB | Only if the WC renders PrimeVue components (`