gutenberg
gutenberg copied to clipboard
Fix: Logic for Highlight/text-color format availability
What?
Corrects the logic for showing the text-color format, either if a palette is present or if custom colors are allowed, as expected.
Why?
Previous logic mistakenly resulted in an unusable text color UI when palette was empty and custom was false, but offered no text color UI at all if palette was empty and custom was set to true.
How?
Flipped test on allowCustomControl.
Testing Instructions
- Open theme.json
- Under color settings, palette to [], custom to false
- Open a post or page, insert a text block
- Open the format dropdown, Highlight should be absent
For the inverse:
- Set color.custom to true
- Open editor, select/insert text block
- Open format dropdown, Highlight should be present, selecting will allow custom color selection