-
Notifications
You must be signed in to change notification settings - Fork 342
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
Fix/ssr css variables #3055
Fix/ssr css variables #3055
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic is pretty hard for understanding, please comment it as much as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if related to this pr, but if you're using light theme of the nuxt-docs and then go to http://localhost:3000/en/styles/colors, it automatically switches to the dark one.
That's pretty weird.
closes #3046
Added a build plugin which converts
v-bind(variable)
in <style> to:style=""
.Basically, creates a css variable like
--va-[index]-[kebab-name]
and pass it to style using v-bind and replaces vue v-bind in css with generated css variable. This way we ignore vueuseCSSVars
which is not available in cjs build. We also ensure that passed value to css variable is going to be String, which makes it work in Nuxt.