-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any string interpolations in global
tags breaks styled-jsx
#710
Comments
Update: It seems to work when I wrap the interpolation in the
Complains about not being able to use dynamic styles in |
Just came across this same issue... wrapping the interpolation in quotes made it work for me: <style jsx global>{`"${normalize}"`}</style>
// also worked with a function
function normalize(input) {
// ...
return input;
}
<style jsx global>{`"${normalize(styles)}"`}</style> |
Got same issue I tried to custom dynamically my style with styled-jsx like the following code : return (
<div className={`wrapper-split ${styles.wrapperSplit}`}>
{memoSplitScreen}
<style global jsx>{`
${style} .wrapper-split {
overflow: hidden;
}
`}</style>
</div>
); style look like : .wrapper-split div[class^=split-img] .Experts img {padding:10% !important} (type of string) the style and the tag work fine in the localhost but published on vercel the tag 'style' do not existe anymore in the code.... |
Here's what worked for me: <style jsx global>{`${pageStyles}`}</style> I still don't understand why the above works but the following doesn't. <style jsx global>{pageStyles}</style> |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Using constants or functions in a
<style jsx global>
tag results in either no style tag being rendered, or a broken style output.Eg:
My particular use-case is using the
normalize
andfontFace
utilities from Satchel with styled-jsxWhat is the expected behavior?
Template literal interpolations should work in global style tags, or should at least behave consistently.
Environment (include versions)
Did this work in previous versions?
Untested
The text was updated successfully, but these errors were encountered: