-
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
Block Editor: Consider removing the contrast checker when block has only links #37549
Comments
@jorgefilipecosta, I would be curious to hear your feedback what would be the ideal solution for this edge case? As far as I can see in the codebase, there is no way to use block supports to disable the contrast checker. I played a bit with a very naive approach where the contrast checker would be disabled when there is no block support enabled for the text color in this place: gutenberg/packages/block-editor/src/hooks/color.js Lines 377 to 380 in 3d52a8c
So the check would ensure that is only enabled when : Platform.OS === 'web' && ! gradient && ! style?.color?.gradient && hasTextColor && hasBackgroundColor The question is whether we want to improve the experience and offer a contrast checker also for links vs background but in that case we would have to convert this issue into an enhancement. |
Similar issue over at #38428 (comment) but related to the Separator Block. Excerpts from that discussion:
The Separator Block isn't really meant to house text, but the contrast checker detects an inherited I think it would be helpful to completely disable (or enable) the contrast checker for specific blocks, possibly through What do you think? |
Description
Discovered this while testing the Comment Reply Link and Comment Edit Link blocks. Both blocks don't contain any regular text because everything is wrapped with a link. It also means that block supports have color controls enabled only for the background and the link. Initially reported in #35774 (comment)
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
The up to date version looks this way:
Environment info
trunk
)The browser and OS don't matter here.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: