diff --git a/packages/block-editor/src/hooks/style.js b/packages/block-editor/src/hooks/style.js index 19774b709ec7e..cf5626b684315 100644 --- a/packages/block-editor/src/hooks/style.js +++ b/packages/block-editor/src/hooks/style.js @@ -331,13 +331,17 @@ const withElementsStyles = createHigherOrderComponent( BlockListBlock ) }`; - const skipSerialization = shouldSkipSerialization( + const skipLinkColorSerialization = shouldSkipSerialization( props.name, COLOR_SUPPORT_KEY, 'link' ); - const elements = skipSerialization + // The Elements API only supports link colors for now, + // hence the specific omission of `link` in the elements styles. + // This might need to be refactored or removed if the Elements API + // changes or `link` supports styles beyond `color`. + const elements = skipLinkColorSerialization ? omit( props.attributes.style?.elements, [ 'link' ] ) : props.attributes.style?.elements;