Open loopmasta opened 2 years ago
@kathrynwp 👍
Was coming here to suggest the same general idea. I like the idea of tailoring existing controls.
@skorasaurus This issue is not about inserting settings to a Color panel that you add to your code (e.g. InspectorControls) and have control over but a Color panel that is controlled and rendered via the supports API and therefor excludes the possibility to change its settings. The proposed patch allows a developer to do just that.
What problem does this address?
The hardcoded label 'Text' of the color picker component generated by the supports API is misleading if the output of a block is not text but a font icon or some other output which is not recognised by the user as text. This patch enables a Gutenberg block developer to add a optional label to the otherwise hardcoded label 'Text' of the color picker.
What is your proposed solution?
The supports API for the color section is extended by a new key e.g. experimentalTextLabel. If this key exists and has a value the default label 'Text' is replaced by this value. To use it register a block with the supports API color feature and add the key experimentalTextLabel with a I18N string. See example below.