Skip to content

Commit

Permalink
Update Line-Height Settings for opt-in (rather than opt-out) (#23904)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Q authored Jul 15, 2020
1 parent 7aacd09 commit 3e2b49b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/line-height.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class EditorProvider extends Component {
'__experimentalBlockPatterns',
'__experimentalBlockPatternCategories',
'__experimentalDisableCustomUnits',
'__experimentalDisableCustomLineHeight',
'__experimentalEnableCustomLineHeight',
'__experimentalEnableCustomSpacing',
'__experimentalEnableLegacyWidgetBlock',
'__experimentalEnableLinkColor',
Expand Down

0 comments on commit 3e2b49b

Please sign in to comment.