-
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
Separator: disable the contrastChecker via block.json #43357
Changes from 2 commits
449463f
d6f0311
b910975
6f0285c
d2562b3
899f3b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,7 +292,7 @@ const getLinkColorFromAttributeValue = ( colors, value ) => { | |
export function ColorEdit( props ) { | ||
const { name: blockName, attributes } = props; | ||
// Some color settings have a special handling for deprecated flags in `useSetting`, | ||
// so we can't unwrap them by doing const { ... } = useSetting('color') | ||
// so we can't unwrap them by doing conwst { ... } = useSetting('color') | ||
// until https://github.com/WordPress/gutenberg/issues/37094 is fixed. | ||
const userPalette = useSetting( 'color.palette.custom' ); | ||
const themePalette = useSetting( 'color.palette.theme' ); | ||
|
@@ -450,14 +450,22 @@ export function ColorEdit( props ) { | |
}; | ||
}; | ||
|
||
const enableContrastChecking = | ||
const isWebAndColorNotGradient = | ||
Platform.OS === 'web' && ! gradient && ! style?.color?.gradient; | ||
|
||
const defaultColorControls = getBlockSupport( props.name, [ | ||
COLOR_SUPPORT_KEY, | ||
'__experimentalDefaultControls', | ||
] ); | ||
|
||
const enableContrastChecking = | ||
isWebAndColorNotGradient && | ||
true === | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to default support to true somehow, or switch this to a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed with comment added. 🙇 |
||
getBlockSupport( props.name, [ | ||
COLOR_SUPPORT_KEY, | ||
'__experimentalCheckContrast', | ||
] ); | ||
|
||
return ( | ||
<ColorPanel | ||
enableContrastChecking={ enableContrastChecking } | ||
|
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.
In fact, we can't destructure any return values with
conwst { ... }
, which is an oversight on the part of the javascript technical committee I think 😄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'll propose it at the next mweeting. 😄