Pigment CSS migration limits for runtime theming and dynamic sx usage
0 reputation · 17 Aug 2021, 06:12 UTC
Material UI's default styling resolves at runtime through the styled engine, while the zero-runtime Pigment CSS alternative extracts styles at build time. For applications that depend on runtime theme switching and dynamic sx expressions, the migration boundary is not always clear. The documented trade-off is that build-time extraction removes runtime cost but sacrifices runtime theming and parts of the dynamic sx API. Because availability and packaging differ across major releases, teams must confirm whether their installed version treats Pigment CSS as experimental or production-ready before committing to an architecture.
Is there a supported pattern for selectively using zero-runtime CSS for static components while retaining the runtime engine for dynamic theming? What criteria determine whether a given sx expression is compatible with build-time extraction? Does the migration require a global switch, or can both engines coexist during incremental adoption?