Skip to content
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

Merged
merged 5 commits into from
Mar 4, 2023
Merged

Conversation

m0ksem
Copy link
Collaborator

@m0ksem m0ksem commented Feb 23, 2023

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 vue useCSSVars 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.

@m0ksem m0ksem added the build Build process label Feb 23, 2023
@m0ksem m0ksem requested a review from aluarius February 23, 2023 17:47
@m0ksem m0ksem self-assigned this Feb 23, 2023
Copy link
Contributor

@aluarius aluarius left a 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.

@m0ksem m0ksem requested a review from aluarius February 28, 2023 17:58
Copy link
Contributor

@aluarius aluarius left a 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.

@m0ksem m0ksem merged commit f43b165 into epicmaxco:develop Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR does not add component variables
2 participants