diff --git a/lib/block-supports/colors.php b/lib/block-supports/colors.php index 8649b14d6d6095..b0bb4e1e22ada9 100644 --- a/lib/block-supports/colors.php +++ b/lib/block-supports/colors.php @@ -13,7 +13,7 @@ function gutenberg_register_colors_support( $block_type ) { $color_support = false; if ( property_exists( $block_type, 'supports' ) ) { - $color_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalColor' ), false ); + $color_support = gutenberg_experimental_get( $block_type->supports, array( 'color' ), false ); } $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'background' ), true ) ); @@ -60,10 +60,10 @@ function gutenberg_register_colors_support( $block_type ) { * @return array Colors CSS classes and inline styles. */ function gutenberg_apply_colors_support( $attributes, $block_attributes, $block_type ) { - $color_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalColor' ), false ); + $color_support = gutenberg_experimental_get( $block_type->supports, array( 'color' ), false ); $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'background' ), true ) ); - $has_link_colors_support = gutenberg_experimental_get( $color_support, array( 'linkColor' ), false ); + $has_link_colors_support = gutenberg_experimental_get( $color_support, array( 'link' ), false ); $has_gradients_support = gutenberg_experimental_get( $color_support, array( 'gradients' ), false ); // Text Colors. diff --git a/lib/global-styles.php b/lib/global-styles.php index 1fbdf36f00d95c..52c7b3e5d7a533 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -417,10 +417,10 @@ function gutenberg_experimental_global_styles_get_style_property() { */ function gutenberg_experimental_global_styles_get_support_keys() { return array( - '--wp--style--color--link' => array( '__experimentalColor', 'linkColor' ), - 'background' => array( '__experimentalColor', 'gradients' ), - 'backgroundColor' => array( '__experimentalColor' ), - 'color' => array( '__experimentalColor' ), + '--wp--style--color--link' => array( 'color', 'link' ), + 'background' => array( 'color', 'gradients' ), + 'backgroundColor' => array( 'color' ), + 'color' => array( 'color' ), 'fontSize' => array( '__experimentalFontSize' ), 'lineHeight' => array( '__experimentalLineHeight' ), ); @@ -485,8 +485,8 @@ function gutenberg_experimental_global_styles_get_block_data() { 'supports' => array( '__experimentalSelector' => ':root', '__experimentalFontSize' => true, - '__experimentalColor' => array( - 'linkColor' => true, + 'color' => array( + 'link' => true, 'gradients' => true, ), ), diff --git a/packages/block-editor/src/hooks/color.js b/packages/block-editor/src/hooks/color.js index d1962e7011cb2f..2f083d9af2f942 100644 --- a/packages/block-editor/src/hooks/color.js +++ b/packages/block-editor/src/hooks/color.js @@ -30,7 +30,7 @@ import { cleanEmptyObject } from './utils'; import ColorPanel from './color-panel'; import useEditorFeature from '../components/use-editor-feature'; -export const COLOR_SUPPORT_KEY = '__experimentalColor'; +export const COLOR_SUPPORT_KEY = 'color'; const EMPTY_ARRAY = []; const hasColorSupport = ( blockType ) => { @@ -40,7 +40,7 @@ const hasColorSupport = ( blockType ) => { const colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY ); return ( colorSupport && - ( colorSupport.linkColor === true || + ( colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false ) @@ -54,7 +54,7 @@ const hasLinkColorSupport = ( blockType ) => { const colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY ); - return isObject( colorSupport ) && !! colorSupport.linkColor; + return isObject( colorSupport ) && !! colorSupport.link; }; const hasGradientSupport = ( blockType ) => { diff --git a/packages/block-library/src/button/deprecated.js b/packages/block-library/src/button/deprecated.js index 5316e590bd50fb..110807907fc3c3 100644 --- a/packages/block-library/src/button/deprecated.js +++ b/packages/block-library/src/button/deprecated.js @@ -85,7 +85,7 @@ const deprecated = [ supports: { align: true, alignWide: false, - __experimentalColor: { gradients: true }, + color: { gradients: true }, }, attributes: { ...blockAttributes, diff --git a/packages/block-library/src/columns/block.json b/packages/block-library/src/columns/block.json index 0a84a4a35d7812..a7cdf327d5ae51 100644 --- a/packages/block-library/src/columns/block.json +++ b/packages/block-library/src/columns/block.json @@ -14,9 +14,9 @@ ], "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true } } } diff --git a/packages/block-library/src/group/block.json b/packages/block-library/src/group/block.json index a2d0cc083a9f6d..28f40ed5094faa 100644 --- a/packages/block-library/src/group/block.json +++ b/packages/block-library/src/group/block.json @@ -15,9 +15,9 @@ "anchor": true, "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalPadding": true } diff --git a/packages/block-library/src/heading/block.json b/packages/block-library/src/heading/block.json index fd03a4487ee5aa..ce65c1ab21dece 100644 --- a/packages/block-library/src/heading/block.json +++ b/packages/block-library/src/heading/block.json @@ -23,8 +23,8 @@ "anchor": true, "className": false, "lightBlockWrapper": true, - "__experimentalColor": { - "linkColor": true + "color": { + "link": true }, "__experimentalFontSize": true, "__experimentalLineHeight": true, diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index 3fa10c51a1f859..ccc47db5ec06bc 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -27,7 +27,7 @@ "supports": { "anchor": true, "className": false, - "__experimentalColor": { + "color": { "gradients": true }, "__unstablePasteTextInline": true, diff --git a/packages/block-library/src/media-text/block.json b/packages/block-library/src/media-text/block.json index 9911c4d35edc1b..978ebabef59185 100644 --- a/packages/block-library/src/media-text/block.json +++ b/packages/block-library/src/media-text/block.json @@ -85,9 +85,9 @@ "align": [ "wide", "full" ], "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true } } } diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index d12d267cf26a1b..aa6e3772b51f0d 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -50,7 +50,7 @@ "inserter": true, "lightBlockWrapper": true, "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "textColor": true, "backgroundColor": true } diff --git a/packages/block-library/src/paragraph/block.json b/packages/block-library/src/paragraph/block.json index 91d8ad357f7ebf..851e1d609d2477 100644 --- a/packages/block-library/src/paragraph/block.json +++ b/packages/block-library/src/paragraph/block.json @@ -30,8 +30,8 @@ "anchor": true, "className": false, "lightBlockWrapper": true, - "__experimentalColor": { - "linkColor": true + "color": { + "link": true }, "__experimentalFontSize": true, "__experimentalLineHeight": true, diff --git a/packages/block-library/src/post-author/block.json b/packages/block-library/src/post-author/block.json index 3e788777dec81d..2e93b12efc59f0 100644 --- a/packages/block-library/src/post-author/block.json +++ b/packages/block-library/src/post-author/block.json @@ -28,9 +28,9 @@ "html": false, "lightBlockWrapper": true, "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalLineHeight": true } diff --git a/packages/block-library/src/post-comments-count/block.json b/packages/block-library/src/post-comments-count/block.json index 5908f13b721c76..b3a1ad83ef9d3b 100644 --- a/packages/block-library/src/post-comments-count/block.json +++ b/packages/block-library/src/post-comments-count/block.json @@ -12,7 +12,7 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true }, "__experimentalFontSize": true, diff --git a/packages/block-library/src/post-comments-form/block.json b/packages/block-library/src/post-comments-form/block.json index c0e131b83b231b..3f86d699afcc9c 100644 --- a/packages/block-library/src/post-comments-form/block.json +++ b/packages/block-library/src/post-comments-form/block.json @@ -13,9 +13,9 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalFontSize": true, "__experimentalLineHeight": true diff --git a/packages/block-library/src/post-comments/block.json b/packages/block-library/src/post-comments/block.json index 51dbb5c22dcbcc..89ffe296363773 100644 --- a/packages/block-library/src/post-comments/block.json +++ b/packages/block-library/src/post-comments/block.json @@ -18,9 +18,9 @@ "full" ], "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalLineHeight": true } diff --git a/packages/block-library/src/post-date/block.json b/packages/block-library/src/post-date/block.json index 872bf705c01162..6ac5c23e52f82d 100644 --- a/packages/block-library/src/post-date/block.json +++ b/packages/block-library/src/post-date/block.json @@ -16,7 +16,7 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true }, "__experimentalFontSize": true, diff --git a/packages/block-library/src/post-excerpt/block.json b/packages/block-library/src/post-excerpt/block.json index 28952d268ff922..41c98a86ba1566 100644 --- a/packages/block-library/src/post-excerpt/block.json +++ b/packages/block-library/src/post-excerpt/block.json @@ -25,9 +25,9 @@ "html": false, "lightBlockWrapper": true, "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalLineHeight": true } diff --git a/packages/block-library/src/post-hierarchical-terms/block.json b/packages/block-library/src/post-hierarchical-terms/block.json index 0afec0b02857af..b03942e8a96aef 100644 --- a/packages/block-library/src/post-hierarchical-terms/block.json +++ b/packages/block-library/src/post-hierarchical-terms/block.json @@ -17,9 +17,9 @@ "html": false, "lightBlockWrapper": true, "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalLineHeight": true } diff --git a/packages/block-library/src/post-tags/block.json b/packages/block-library/src/post-tags/block.json index 4b4c95c0b351dc..c56df18a7ce608 100644 --- a/packages/block-library/src/post-tags/block.json +++ b/packages/block-library/src/post-tags/block.json @@ -11,9 +11,9 @@ "html": false, "lightBlockWrapper": true, "__experimentalFontSize": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true }, "__experimentalLineHeight": true } diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index 70cfbdec753be3..106f1e58638dc2 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -30,7 +30,7 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true }, "__experimentalFontSize": true, diff --git a/packages/block-library/src/site-tagline/block.json b/packages/block-library/src/site-tagline/block.json index b0b4d5ab95b0b0..2b867dece0c442 100644 --- a/packages/block-library/src/site-tagline/block.json +++ b/packages/block-library/src/site-tagline/block.json @@ -9,7 +9,7 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true }, "__experimentalFontSize": true, diff --git a/packages/block-library/src/site-title/block.json b/packages/block-library/src/site-title/block.json index 4817093296629a..460944a9455698 100644 --- a/packages/block-library/src/site-title/block.json +++ b/packages/block-library/src/site-title/block.json @@ -13,7 +13,7 @@ "supports": { "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true }, "__experimentalFontSize": true, diff --git a/packages/block-library/src/template-part/block.json b/packages/block-library/src/template-part/block.json index 839fe03f0759c7..e79c8f92e991a4 100644 --- a/packages/block-library/src/template-part/block.json +++ b/packages/block-library/src/template-part/block.json @@ -20,9 +20,9 @@ "align": true, "html": false, "lightBlockWrapper": true, - "__experimentalColor": { + "color": { "gradients": true, - "linkColor": true + "link": true } } } diff --git a/packages/edit-navigation/src/index.js b/packages/edit-navigation/src/index.js index db23acc1945f9c..cca55f8bb797eb 100644 --- a/packages/edit-navigation/src/index.js +++ b/packages/edit-navigation/src/index.js @@ -43,7 +43,7 @@ function removeNavigationBlockSettingsUnsupportedFeatures( settings, name ) { ...omit( settings.supports, [ 'anchor', 'customClassName', - '__experimentalColor', + 'color', '__experimentalFontSize', ] ), customClassName: false, diff --git a/phpunit/class-block-supported-styles-test.php b/phpunit/class-block-supported-styles-test.php index fef5e2bf45d1a8..44c29e68253769 100644 --- a/phpunit/class-block-supported-styles-test.php +++ b/phpunit/class-block-supported-styles-test.php @@ -143,7 +143,7 @@ function test_named_color_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => true, + 'color' => true, ), 'render_callback' => true, ); @@ -175,7 +175,7 @@ function test_custom_color_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => true, + 'color' => true, ), 'render_callback' => true, ); @@ -212,8 +212,8 @@ function test_named_link_color_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => array( - 'linkColor' => true, + 'color' => array( + 'link' => true, ), ), 'render_callback' => true, @@ -243,8 +243,8 @@ function test_custom_link_color_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => array( - 'linkColor' => true, + 'color' => array( + 'link' => true, ), ), 'render_callback' => true, @@ -274,7 +274,7 @@ function test_named_gradient_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => array( + 'color' => array( 'gradients' => true, ), ), @@ -305,7 +305,7 @@ function test_custom_gradient_support() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => array( + 'color' => array( 'gradients' => true, ), ), @@ -570,9 +570,9 @@ function test_all_supported() { $block_type_settings = array( 'attributes' => array(), 'supports' => array( - '__experimentalColor' => array( + 'color' => array( 'gradients' => true, - 'linkColor' => true, + 'link' => true, ), '__experimentalFontSize' => true, '__experimentalLineHeight' => true, @@ -660,9 +660,9 @@ function test_render_callback_required() { 'attributes' => array(), 'supports' => array( 'align' => true, - '__experimentalColor' => array( + 'color' => array( 'gradients' => true, - 'linkColor' => true, + 'link' => true, ), '__experimentalFontSize' => true, '__experimentalLineHeight' => true,