From 1bc26b85ac563be2c9b666d790a9f0dc89809082 Mon Sep 17 00:00:00 2001 From: jasmussen Date: Mon, 22 Mar 2021 08:21:03 +0100 Subject: [PATCH 1/2] Try: Rephrase, polish, and make consistent color labels. --- lib/block-supports/colors.php | 4 ++-- packages/block-editor/src/components/colors/use-colors.js | 8 ++++---- packages/block-editor/src/hooks/color-panel.js | 2 +- packages/block-editor/src/hooks/color.js | 4 ++-- packages/block-library/src/button/color-edit.js | 8 +++----- packages/block-library/src/pullquote/edit.js | 2 +- .../block-library/src/separator/separator-settings.js | 2 +- packages/block-library/src/social-links/edit.js | 4 ++-- packages/block-library/src/table/edit.js | 2 +- packages/e2e-tests/specs/editor/blocks/heading.test.js | 2 +- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/block-supports/colors.php b/lib/block-supports/colors.php index 0ccc3e9823c7ae..06c6649a1cd4dc 100644 --- a/lib/block-supports/colors.php +++ b/lib/block-supports/colors.php @@ -81,7 +81,7 @@ function gutenberg_apply_colors_support( $block_type, $block_attributes ) { $classes = array(); $styles = array(); - // Text Colors. + // Text colors. // Check support for text colors. if ( $has_text_colors_support ) { $has_named_text_color = array_key_exists( 'textColor', $block_attributes ); @@ -117,7 +117,7 @@ function gutenberg_apply_colors_support( $block_type, $block_attributes ) { } } - // Background Colors. + // Background colors. if ( $has_background_colors_support ) { $has_named_background_color = array_key_exists( 'backgroundColor', $block_attributes ); $has_custom_background_color = isset( $block_attributes['style']['color']['background'] ); diff --git a/packages/block-editor/src/components/colors/use-colors.js b/packages/block-editor/src/components/colors/use-colors.js index 87f7f2278a1e5e..3d4cbf717ad5e5 100644 --- a/packages/block-editor/src/components/colors/use-colors.js +++ b/packages/block-editor/src/components/colors/use-colors.js @@ -35,8 +35,8 @@ function getComputedStyle( node ) { const DEFAULT_COLORS = []; const COMMON_COLOR_LABELS = { - textColor: __( 'Text Color' ), - backgroundColor: __( 'Background Color' ), + textColor: __( 'Text color' ), + backgroundColor: __( 'Background color' ), }; const InspectorControlsColorPanel = ( props ) => ( @@ -48,7 +48,7 @@ const InspectorControlsColorPanel = ( props ) => ( export default function __experimentalUseColors( colorConfigs, { - panelTitle = __( 'Color settings' ), + panelTitle = __( 'Color' ), colorPanelProps, contrastCheckers, panelChildren, @@ -58,7 +58,7 @@ export default function __experimentalUseColors( textColorTargetRef = targetRef, } = {}, } = { - panelTitle: __( 'Color settings' ), + panelTitle: __( 'Color' ), }, deps = [] ) { diff --git a/packages/block-editor/src/hooks/color-panel.js b/packages/block-editor/src/hooks/color-panel.js index 9b5f49cce723c0..9b93203b3d265a 100644 --- a/packages/block-editor/src/hooks/color-panel.js +++ b/packages/block-editor/src/hooks/color-panel.js @@ -55,7 +55,7 @@ export default function ColorPanel( { return ( diff --git a/packages/block-editor/src/hooks/color.js b/packages/block-editor/src/hooks/color.js index d8821b16713f39..431e1956989ac4 100644 --- a/packages/block-editor/src/hooks/color.js +++ b/packages/block-editor/src/hooks/color.js @@ -327,7 +327,7 @@ export function ColorEdit( props ) { ...( hasTextColorSupport( blockName ) ? [ { - label: __( 'Text Color' ), + label: __( 'Text color' ), onColorChange: onChangeColor( 'text' ), colorValue: getColorObjectByAttributeValues( colors, @@ -340,7 +340,7 @@ export function ColorEdit( props ) { ...( hasBackground || hasGradient ? [ { - label: __( 'Background Color' ), + label: __( 'Background color' ), onColorChange: hasBackground ? onChangeColor( 'background' ) : undefined, diff --git a/packages/block-library/src/button/color-edit.js b/packages/block-library/src/button/color-edit.js index e5611a97aee69d..e1ea55bf744e65 100644 --- a/packages/block-library/src/button/color-edit.js +++ b/packages/block-library/src/button/color-edit.js @@ -68,9 +68,7 @@ function ColorPanel( { settings, clientId, enableContrastChecking = true } ) { const [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState(); const [ detectedColor, setDetectedColor ] = useState(); - const title = isWebPlatform - ? __( 'Color settings' ) - : __( 'Color Settings' ); + const title = __( 'Color' ); useEffect( () => { if ( isWebPlatform && ! enableContrastChecking ) { @@ -209,7 +207,7 @@ function ColorEdit( props ) { const settings = useMemo( () => { return [ { - label: __( 'Text Color' ), + label: __( 'Text color' ), onColorChange: onChangeColor( 'text' ), colorValue: getColorObjectByAttributeValues( colors, @@ -218,7 +216,7 @@ function ColorEdit( props ) { ).color, }, { - label: __( 'Background Color' ), + label: __( 'Background color' ), onColorChange: onChangeColor( 'background' ), colorValue: getColorObjectByAttributeValues( colors, diff --git a/packages/block-library/src/pullquote/edit.js b/packages/block-library/src/pullquote/edit.js index 709f3745108741..40f096e86f0620 100644 --- a/packages/block-library/src/pullquote/edit.js +++ b/packages/block-library/src/pullquote/edit.js @@ -160,7 +160,7 @@ function PullQuoteEdit( { { Platform.OS === 'web' && ( ( diff --git a/packages/block-library/src/table/edit.js b/packages/block-library/src/table/edit.js index 5876f7f956c250..0f5c1f97d770b8 100644 --- a/packages/block-library/src/table/edit.js +++ b/packages/block-library/src/table/edit.js @@ -500,7 +500,7 @@ function TableEdit( { /> { const COLOR_INPUT_FIELD_SELECTOR = '.components-color-palette__picker .components-text-control__input'; const COLOR_PANEL_TOGGLE_X_SELECTOR = - "//button[./span[contains(text(),'Color settings')]]"; + "//button[./span[contains(text(),'Color')]]"; beforeEach( async () => { await createNewPost(); From 37186a9dc3a6ce6c3c39031787cc7352bba49cad Mon Sep 17 00:00:00 2001 From: jasmussen Date: Mon, 22 Mar 2021 08:57:52 +0100 Subject: [PATCH 2/2] Restore background color. --- packages/block-library/src/social-links/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/social-links/edit.js b/packages/block-library/src/social-links/edit.js index 75f5ca54e91aca..3aa3e854be6500 100644 --- a/packages/block-library/src/social-links/edit.js +++ b/packages/block-library/src/social-links/edit.js @@ -205,7 +205,7 @@ export function SocialLinksEdit( props ) { iconBackgroundColorValue: colorValue, } ); }, - label: __( 'Background color' ), + label: __( 'Icon background color' ), }, ] } />