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

Selecting a theme gradient doesn't update the gradient bar color #43715

Open
mirka opened this issue Aug 30, 2022 · 3 comments · May be fixed by #63915
Open

Selecting a theme gradient doesn't update the gradient bar color #43715

mirka opened this issue Aug 30, 2022 · 3 comments · May be fixed by #63915
Assignees
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mirka
Copy link
Member

mirka commented Aug 30, 2022

Clicking on a theme gradient doesn't update the gradient bar UI:

Selecting a theme gradient for the Cover block

The isolated instances in Storybook for the GradientPicker component are working fine, so there is likely something wrong with the data flow in the block editor usage.


Reported by @jasmussen

@mirka mirka added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor labels Aug 30, 2022
@luminuu
Copy link
Member

luminuu commented May 22, 2024

Upon searching for this behaviour I found this issue and can confirm it does happen when CSS variables are used. Twenty Twenty-Four uses hex codes in the gradients, while for example Twenty Twenty-Three in the Sherbet style variation, CSS variables are used. It is reproduceable there.

To reproduce, the use code like this in a gradient in theme.json:
linear-gradient(135deg,var(--wp--preset--color--primary) 0%,var(--wp--preset--color--secondary) 100%)

@luminuu
Copy link
Member

luminuu commented Jul 24, 2024

Related ticket: #28254

@mirka
Copy link
Member Author

mirka commented Jul 24, 2024

I have a potential solution in #63915, but I noticed that two of the Sherbet gradients have a fixed keyword at the end, and are invalid as gradient values. fixed is a background keyword and valid as part of a background value, but not necessarily in other contexts where a gradient value can be used, e.g. mask-image. So unfortunately that gradient string is invalid and cannot be parsed by a gradient parser. It's not impossible to implement a workaround, but ideally the theme value should be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants