From 09683b947eda1460f5e7446d9226fafe0787f17a Mon Sep 17 00:00:00 2001 From: Jon Q Date: Mon, 13 Jul 2020 10:53:08 -0400 Subject: [PATCH] Update Line-Height Settings for opt-in (rather than opt-out) This update adjusts the line-height theme support setting to be opt-in via `add_theme_support( 'experimental-line-height' );` rather than enabled by default. This keeps it consistent with the other recently added style theme support settings like padding (spacing). --- lib/client-assets.php | 2 +- packages/block-editor/src/hooks/line-height.js | 2 +- packages/editor/src/components/provider/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index ee7993c71c5a9a..e87cb3fd22e360 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -655,7 +655,7 @@ function gutenberg_extend_settings_block_patterns( $settings ) { * @return array Filtered editor settings. */ function gutenberg_extend_settings_custom_line_height( $settings ) { - $settings['__experimentalDisableCustomLineHeight'] = get_theme_support( 'disable-custom-line-height' ); + $settings['__experimentalEnableCustomLineHeight'] = get_theme_support( 'experimental-line-height' ); return $settings; } add_filter( 'block_editor_settings', 'gutenberg_extend_settings_custom_line_height' ); diff --git a/packages/block-editor/src/hooks/line-height.js b/packages/block-editor/src/hooks/line-height.js index 21698a886a8f40..40a3cdb66ef31a 100644 --- a/packages/block-editor/src/hooks/line-height.js +++ b/packages/block-editor/src/hooks/line-height.js @@ -59,7 +59,7 @@ export function useIsLineHeightDisabled( { name: blockName } = {} ) { const isDisabled = useSelect( ( select ) => { const editorSettings = select( 'core/block-editor' ).getSettings(); - return editorSettings.__experimentalDisableCustomLineHeight; + return ! editorSettings.__experimentalEnableCustomLineHeight; } ); return ( diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index edbeaaace33951..e224a3ee3c8a7c 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -115,7 +115,7 @@ class EditorProvider extends Component { '__experimentalBlockPatterns', '__experimentalBlockPatternCategories', '__experimentalDisableCustomUnits', - '__experimentalDisableCustomLineHeight', + '__experimentalEnableCustomLineHeight', '__experimentalEnableCustomSpacing', '__experimentalEnableLegacyWidgetBlock', '__experimentalEnableLinkColor',