Skip to content

Commit

Permalink
Simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 15, 2023
1 parent 15317d7 commit 21802dc
Showing 1 changed file with 14 additions and 41 deletions.
55 changes: 14 additions & 41 deletions packages/block-editor/src/components/global-styles/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,47 +246,20 @@ export function overrideSettingsWithSupports( settings, supports ) {
};
}

if ( ! supports.includes( 'lineHeight' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
lineHeight: false,
};
}

if ( ! supports.includes( 'fontStyle' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
fontStyle: false,
};
}

if ( ! supports.includes( 'fontWeight' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
fontWeight: false,
};
}

if ( ! supports.includes( 'letterSpacing' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
letterSpacing: false,
};
}

if ( ! supports.includes( 'textTransform' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
textTransform: false,
};
}

if ( ! supports.includes( 'textDecoration' ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
textDecoration: false,
};
}
[
'lineHeight',
'fontStyle',
'fontWeight',
'letterSpacing',
'textTransform',
].forEach( ( key ) => {
if ( ! supports.includes( key ) ) {
updatedSettings.typography = {
...updatedSettings.typography,
[ key ]: false,
};
}
} );

return updatedSettings;
}

0 comments on commit 21802dc

Please sign in to comment.