-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix: Gradients are not being applied by class #37597
Fix: Gradients are not being applied by class #37597
Conversation
Size Change: +326 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
export function __experimentalUseGradient( { | ||
gradientAttribute = 'gradient', | ||
customGradientAttribute = 'customGradient', | ||
} = {} ) { | ||
const { clientId } = useBlockEditContext(); | ||
|
||
const gradientsPerOrigin = useSetting( 'color.gradients' ) || EMPTY_OBJECT; | ||
const userGradientPalette = useSetting( 'color.gradients.custom' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain a bit why useSetting( 'color.gradients' )
wouldn't work? Is it because we want to remove support for retrieval of top level settings(which this is not) and a combination of custom handling for some settings, origin priority and deprecated fallbacks? Do we have a problem/different handling for other settings?
I saw a lot of connected PRs about this but I don't have much context in this area and would like to understand it better.
Co-authored-by: André <[email protected]>
This PR fixes an issue that made the preset gradients not applied by class but by custom value.
How has this been tested?
I added a group block I selected a theme gradient.
I added a cover block I selected a default gradient.
I verified on the code editor both gradients were applied using a class (on trunk they are not).