UNSAFE_RUNTIME_CSS: CSS built at run time
| Severity | Fault | Stage |
|---|---|---|
| error | customer (the source package) | build output |
What it means
Section titled “What it means”The component creates a <style> element, a CSSStyleSheet or calls insertRule or replaceSync, so its CSS is made at run time. The build checks the component’s CSS for @import, network url() and declared parts and variables; CSS made at run time skips those checks, and a <style> element needs the host page’s style-src (rule runtime-css).
How to fix
Section titled “How to fix”Put the CSS in a .css or .scss file the component imports, or in defineTaggorComponent({ styles }); for values that change, set a CSS variable in a style prop.