Microfrontends and theming: visual consistency vs host coupling #4292
Unanswered
victoraf-11
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Microfrontends + theming: visual consistency vs host coupling
I'm a frontend engineer working primarily with Angular and microfrontend-based architectures. In our current setup, microfrontends are independently developed and deployed, and composed into a host application.
The specific composition mechanism (Module Federation, single-spa, iframe-based, etc.) is intentionally not the focus here. The question is architectural and framework-agnostic.
The core problem is the following:
In our case, Angular Material is used today, but the concerns described below should apply equally to any UI framework or design system.
Possible approaches
1. Centralized theming in the host
The host application defines the theme and produces the final CSS at build time. Microfrontends implicitly inherit this styling at runtime.
Concerns:
2. Theming defined independently in host and MFEs
Both the host and each microfrontend define their own theming configuration.
Concerns:
3. Global design tokens provided by the host
The host exposes design tokens (CSS variables for colors, typography, spacing, etc.). Microfrontends consume these tokens and define their own local theming on top of them.
Open questions:
4. Per-microfrontend design tokens configured by the host
Each microfrontend defines its own namespaced design tokens. The host configures those tokens at integration time. The microfrontend builds its internal theming using the values provided by the host.
Concerns:
Other related concerns
Asset ownership
Where should assets used by a microfrontend live?
How do you typically define and enforce this boundary in real-world systems?
Questions for the community
Note
This is not a bug report, but an architectural discussion about long-term maintainability, coupling boundaries, and design contracts between hosts and microfrontends.
Beta Was this translation helpful? Give feedback.
All reactions