Skip to content

fix: pass the page's CSP nonce to the MUI style cache (1.0.1) - #19

Merged
AmrMsCLL merged 1 commit into
mainfrom
fix/csp-nonce
Oct 19, 2026
Merged

AmrMsCLL merged 1 commit into
mainfrom
fix/csp-nonce

Conversation

@AmrMsCLL

Copy link
Copy Markdown
Member

MUI injects its styles through Emotion as runtime style tags, which a strict style-src CSP blocks, so Strata's deployed UI rendered unstyled. UiProvider now builds its own layered Emotion cache that reads the nonce from a meta csp-nonce tag. It keeps MUI's @layer mui wrapping, declares the layer order in a nonce'd style tag at the top of head, and adds @emotion/cache as a peer dependency (already in every app through @emotion/react). Without the meta tag nothing changes.

Checked against Strata's server-served build with a nonce CSP: no CSP violations, layer order theme, base, mui, components, utilities.

@github-actions github-actions Bot added the size/s 11-50 changed lines, excluding lockfiles label Oct 19, 2026
@AmrMsCLL
AmrMsCLL merged commit 1c37b08 into main Oct 19, 2026
4 checks passed
@AmrMsCLL
AmrMsCLL deleted the fix/csp-nonce branch October 19, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s 11-50 changed lines, excluding lockfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant