Replies: 1 comment
-
Managed to fix it by removing lib from optimizeDeps.exclude. |
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
-
If I have a Button.vue component that uses v-bind feature, I expect css variables to be rendered on
<button>
the same way if I apply<button :style="--my-bg: red">
.I'm using nuxt with @nuxjs/i18n which somehow forces to nuxt to use cjs build. And the problem here is that before hydration there are no css variables. They're used in CSS code, but they're
unset
because useCSSVars does nothing in cjs build.Original problem comes from here develop.vuestic.dev, we have
backgroundColorOpacity
which is set via v-bind. Before hydration it is unset and backgroundOpacity is 1 by default. This makes button blink - it is blue until hydration is finished.And we also have this issue: epicmaxco/vuestic-ui#3046
I'm not able to make a proper reproduction with sfc.vuejs.org or stackblitz cuz they work with esm build.
How about applying style not with DOM api, but in render function to the root blocks?
Edited:
Looks like
backgroundColorOpacity
var simply do not returns from setup function. Added transform function to get css variables work in SSR:Code
So it looks like this (but no backgroundColorOpacity anyway):
Beta Was this translation helpful? Give feedback.
All reactions