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

Style bind background-image not updating on color-interpolation-method change #9084

Open
BobbieGoede opened this issue Aug 30, 2023 · 2 comments

Comments

@BobbieGoede
Copy link

BobbieGoede commented Aug 30, 2023

Vue version

3.3.4

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-pp4jpy?file=src%2FApp.vue

Steps to reproduce

  • Change the color space input to lch, some of the gradients will change.
  • Change the text color input to blue, text in all gradients change color to blue.
  • Change gradient direction input to left, all gradients will change direction, previous unapplied color space changes are taking effect as well.
  • Change the color space input to srgb, some of the gradients will change.

What is expected?

The background-image style attribute should update when the its value has been changed.

What is actually happening?

The background-image style attribute does not update when the color space (color-interpolation-method) changes. It does update when:

  • No other attributes have been bound to the component
  • A different value inside background-image is changed, such as colors or gradient direction.
  • inheritAttrs is set to false

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm

Any additional comments?

I am working on a gradient picker component and adding support for different color spaces. For some reason the color space wouldn't update, and while trying to create a reproduction it seemed to be working find until I added additional binds/attributes to the component. Please let me know if more information is needed!

@wusiquan
Copy link

wusiquan commented Sep 11, 2023

Change the color space from rgb to lch, the corresponding values should be converted, use css lch() function
I found a useful tool here

@edison1105
Copy link
Member

@BobbieGoede
The issue can no longer be reproduced with your reproduction.
All the gradients will change when I change the color space input to lch or srgb .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants