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

Binding to CSS wrong variable name in SSR #5491

Closed
cydrickn opened this issue Feb 28, 2022 · 1 comment
Closed

Binding to CSS wrong variable name in SSR #5491

cydrickn opened this issue Feb 28, 2022 · 1 comment

Comments

@cydrickn
Copy link

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

create a page with css binding

<script setup>
const banner = `url('https://img.freepik.com/free-photo/hand-painted-watercolor-background-with-sky-clouds-shape_24972-1095.jpg?w=1380')`;
</script>

<template>
    <div class="bannered">
      Test
    </div>
</template>

<style scoped>
.bannered {
  background-image: v-bind(banner);
  height: 100px;
}
</style>

What is expected?

The variable must have --

<div class="bannered" style="--3206028a-banner:url(&#39;/images/company-bg.jpg&#39;);" data-v-3206028a></div><!--]--></div>

What is actually happening?

What happen here is the variable name has no --

<div class="bannered" style="3206028a-banner:url(&#39;/images/company-bg.jpg&#39;);" data-v-3206028a></div><!--]--></div>

So far this issue is not a blocker since in few, milliseconds or seconds once it rendered it will automatically updated to correct name.

But still we should consider to correct it on server side rendering.
Because it will delay the style to be corrected, example the background image, it will delay a few seconds to be display even the image was already cached.

@ygj6
Copy link
Member

ygj6 commented Feb 28, 2022

duplicate of #5443

@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants