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

vue-server-renderer: CSS variables get lost in dynamic style attributes #12374

Open
fieteboerner opened this issue Dec 3, 2021 · 0 comments · May be fixed by #12376
Open

vue-server-renderer: CSS variables get lost in dynamic style attributes #12374

fieteboerner opened this issue Dec 3, 2021 · 0 comments · May be fixed by #12376

Comments

@fieteboerner
Copy link

fieteboerner commented Dec 3, 2021

Version

2.6.14

Reproduction link

github.com

Steps to reproduce

  1. git clone https://github.com/fieteboerner/broken-vue-server-renderer-demo
  2. cd broken-vue-server-renderer-demo
  3. npm install
  4. node index.js

What is expected?

The SSR node index.js command should print the exact same output as the vue renderer in the browser

<div data-server-rendered="true" style="--works-as-expected-but-not-in-my-convention:1px; --notWorkinAtAll:2; --getsKebapCased:2; --getsKabapCasedToo:1px;">Hello World</div>

What is actually happening?

<div data-server-rendered="true" style="--works-as-expected-but-not-in-my-convention:1px;--gets-kebap-cased:2;--gets-kabap-cased-too:1px;">Hello World</div>

The Variable with the integer value is missing, and the lowerCamelCase Variables are converted to kebap-cased variables.

This breaks the UX of our application because the content is jumping since the missing/malformed Variables are not matching the ones in the actual CSS. After rehydration in the Browser, the correct style-Attributes get rendered, and our Styles take effect.


Sidenote

in version 2.5.0 the variable with the numeric value does not get lost. This is the output from version 2.5.0:

<div server-rendered="true" style="--works-as-expected-but-not-in-my-convention:1px;--not-workin-at-all:2;--gets-kebap-cased:2;--gets-kabap-cased-too:1px;">Hello World</div>
fieteboerner pushed a commit to fieteboerner/vue that referenced this issue Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant