-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add option to disable duotone #32002
Conversation
@@ -125,12 +125,14 @@ function DuotonePanel( { attributes, setAttributes } ) { | |||
|
|||
const duotonePalette = useSetting( 'color.duotone' ); | |||
const colorPalette = useSetting( 'color.palette' ); | |||
const disableCustomColors = ! useSetting( 'color.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.
Could we inverse this? It reads more nicely without the double negative:
const customColors = useSetting( 'color.custom' ); // or enableCustomColors
///...
{ customColors && (
<CustomDuotoneBar value={ value } onChange={ onChange } />
}
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.
I was keeping things consistent with how PanelColorGradientSettings
works, but keeping that consistency probably doesn't matter that much
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.
Oh interesting, this one does personally read a bit awkwardly, but It's non-blocking if we're intentionally following this pattern.
Transform from image to cover seems to have that same error even when duotone isn't disabled. I'm looking into a fix that I'll open up in another PR EDIT: added #32006 |
Size Change: +67 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
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.
The test failure is already on trunk and is being investigated, so I'm merging this one. |
❤️ |
Description
Fixes #31764
This allows for duotone to be disabled when
color.duotone
is set tonull
in theme.json as well as respecting settings whencolor.custom === false
andcolor.palette === null
.How has this been tested?
Change settings in theme.json as shown below in the screenshots section.
Screenshots
Types of changes
New feature / Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).