Skip to content

Commit

Permalink
Filter empty longhand CSS styles from inline style generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 17, 2021
1 parent e0ef1d9 commit 706321b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/block-editor/src/hooks/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ export function getInlineStyles( styles = {} ) {

if ( !! subPaths && ! isString( styleValue ) ) {
Object.entries( subPaths ).forEach( ( entry ) => {
const [ name, suffix ] = entry;
output[ name ] = compileStyleValue(
get( styleValue, [ suffix ] )
);
const [ name, subPath ] = entry;
const value = get( styleValue, [ subPath ] );

if ( value ) {
output[ name ] = compileStyleValue( value );
}
} );
} else {
output[ propKey ] = compileStyleValue( get( styles, path ) );
Expand Down

0 comments on commit 706321b

Please sign in to comment.