Skip to content

Commit

Permalink
Migrate customLineHeight to lineHeight in the client
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 3, 2021
1 parent 01ccf2b commit a42946e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/use-setting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ const deprecatedFlags = {
settings.disableCustomFontSizes === undefined
? undefined
: ! settings.disableCustomFontSizes,
'typography.customLineHeight': ( settings ) =>
settings.enableCustomLineHeight,
'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,
'spacing.units': ( settings ) => {
if ( settings.enableCustomUnits === undefined ) {
return;
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 @@ -51,7 +51,7 @@ export function LineHeightEdit( props ) {
* @return {boolean} Whether setting is disabled.
*/
export function useIsLineHeightDisabled( { name: blockName } = {} ) {
const isDisabled = ! useSetting( 'typography.customLineHeight' );
const isDisabled = ! useSetting( 'typography.lineHeight' );

return (
! hasBlockSupport( blockName, LINE_HEIGHT_SUPPORT_KEY ) || isDisabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function useHasTypographyPanel( name ) {
function useHasLineHeightControl( name ) {
const supports = getSupportedGlobalStylesPanels( name );
return (
useSetting( 'typography.customLineHeight', name )[ 0 ] &&
useSetting( 'typography.lineHeight', name )[ 0 ] &&
supports.includes( 'lineHeight' )
);
}
Expand Down

0 comments on commit a42946e

Please sign in to comment.