How to Disable Inline Styles in Mantine v7 #7525
Unanswered
ting-dev-coder
asked this question in
Q&A
Replies: 1 comment
-
These styles cannot be disabled. If you are required to use the strictest CSP possible ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm currently using Mantine v7 and running into a CSP issue. Even though I set up getStyleNonce and used withStaticClasses, Mantine still injects inline styles (like the style attribute on the Button component). This violates CSP because I can't use unsafe-inline in style-src for security reasons.
What I've Tried
getStyleNonce: Tried setting a nonce to handle inline styles, but even with this, Mantine still injects inline styles.
withStaticClasses: This works for disabling dynamic class names, but I still can't remove the inline styles.
HeadlessMantineProvider: I know I can use HeadlessMantineProvider to avoid this issue, but I'm hoping to solve it without having to go that route.
Question
Is there a way to completely disable the inline styles injected by Mantine components without using HeadlessMantineProvider? Or is using HeadlessMantineProvider the only reliable solution?
Is there any other suggestions or solutions?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions