Skip to content

Commit

Permalink
Remove .has-link-color class upon clearing the link color (#34700)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored Sep 9, 2021
1 parent 7c88877 commit 2c56a9c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/block-editor/src/hooks/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,13 @@ export function ColorEdit( props ) {
const newLinkColorValue = colorObject?.slug
? `var:preset|color|${ colorObject.slug }`
: value;
const newStyle = immutableSet(
style,
[ 'elements', 'link', 'color', 'text' ],
newLinkColorValue

const newStyle = cleanEmptyObject(
immutableSet(
style,
[ 'elements', 'link', 'color', 'text' ],
newLinkColorValue
)
);
props.setAttributes( { style: newStyle } );
};
Expand Down

0 comments on commit 2c56a9c

Please sign in to comment.