diff --git a/packages/block-editor/src/components/color-palette/test/__snapshots__/control.js.snap b/packages/block-editor/src/components/color-palette/test/__snapshots__/control.js.snap
index edfd553100317..6052c2ad71567 100644
--- a/packages/block-editor/src/components/color-palette/test/__snapshots__/control.js.snap
+++ b/packages/block-editor/src/components/color-palette/test/__snapshots__/control.js.snap
@@ -32,13 +32,38 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
}
.emotion-4>*+*:not( marquee ) {
- margin-top: calc(4px * 2);
+ margin-top: calc(4px * 1);
}
.emotion-4>* {
min-height: 0;
}
+.emotion-6 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: normal;
+ -webkit-box-align: normal;
+ -ms-flex-align: normal;
+ align-items: normal;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ justify-content: space-between;
+}
+
+.emotion-6>*+*:not( marquee ) {
+ margin-top: calc(4px * 3);
+}
+
+.emotion-6>* {
+ min-height: 0;
+}
+
@@ -59,89 +84,89 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
className="components-base-control__label"
>
Test Color
-
-
-
diff --git a/packages/block-editor/src/components/colors-gradients/control.js b/packages/block-editor/src/components/colors-gradients/control.js
index 8ec461342d093..534c9e3113f3f 100644
--- a/packages/block-editor/src/components/colors-gradients/control.js
+++ b/packages/block-editor/src/components/colors-gradients/control.js
@@ -13,25 +13,16 @@ import {
__experimentalVStack as VStack,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
- ColorIndicator,
ColorPalette,
GradientPicker,
} from '@wordpress/components';
-import { sprintf, __ } from '@wordpress/i18n';
+import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
-import { getColorObjectByColorValue } from '../colors';
-import { __experimentalGetGradientObjectByGradientValue } from '../gradients';
import useSetting from '../use-setting';
-// translators: first %s: the color name or value (e.g. red or #ff0000)
-const colorIndicatorAriaLabel = __( '(Color: %s)' );
-
-// translators: first %s: the gradient name or value (e.g. red to green or linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)
-const gradientIndicatorAriaLabel = __( '(Gradient: %s)' );
-
const colorsAndGradientKeys = [
'colors',
'disableCustomColors',
@@ -39,45 +30,6 @@ const colorsAndGradientKeys = [
'disableCustomGradients',
];
-function VisualLabel( {
- colors,
- gradients,
- label,
- currentTab,
- colorValue,
- gradientValue,
-} ) {
- let value, ariaLabel;
- if ( currentTab === 'color' ) {
- if ( colorValue ) {
- value = colorValue;
- const colorObject = getColorObjectByColorValue( colors, value );
- const colorName = colorObject && colorObject.name;
- ariaLabel = sprintf( colorIndicatorAriaLabel, colorName || value );
- }
- } else if ( currentTab === 'gradient' && gradientValue ) {
- value = gradientValue;
- const gradientObject = __experimentalGetGradientObjectByGradientValue(
- gradients,
- value
- );
- const gradientName = gradientObject && gradientObject.name;
- ariaLabel = sprintf(
- gradientIndicatorAriaLabel,
- gradientName || value
- );
- }
-
- return (
- <>
- { label }
- { !! value && (
-
- ) }
- >
- );
-}
-
function ColorGradientControlInner( {
colors,
gradients,
@@ -90,6 +42,7 @@ function ColorGradientControlInner( {
colorValue,
gradientValue,
clearable,
+ showTitle = true,
} ) {
const canChooseAColor =
onColorChange && ( ! isEmpty( colors ) || ! disableCustomColors );
@@ -111,19 +64,16 @@ function ColorGradientControlInner( {
) }
>