Skip to content

Commit

Permalink
Update for wordpress embed case border styling
Browse files Browse the repository at this point in the history
  • Loading branch information
benazeer-ben committed Nov 26, 2024
1 parent cc18957 commit b0e2645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/block-library/src/embed/embed-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export default function EmbedPreview( {
/* eslint-disable jsx-a11y/no-static-element-interactions */
const embedWrapper =
'wp-embed' === type ? (
<WpEmbedPreview html={ html } />
<WpEmbedPreview
html={ html }
className={ borderProps.className }
style={ { ...borderProps.style } }
/>
) : (
<div
className={ clsx(
Expand Down
7 changes: 5 additions & 2 deletions packages/block-library/src/embed/wp-embed-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const attributeMap = {
marginwidth: 'marginWidth',
};

export default function WpEmbedPreview( { html } ) {
export default function WpEmbedPreview( { html, className, style } ) {
const ref = useRef();
const props = useMemo( () => {
const doc = new window.DOMParser().parseFromString( html, 'text/html' );
Expand Down Expand Up @@ -68,7 +68,10 @@ export default function WpEmbedPreview( { html } ) {
}, [] );

return (
<div className="wp-block-embed__wrapper">
<div
className={ `wp-block-embed__wrapper ${ className }` }
style={ style }
>
<iframe
ref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }
title={ props.title }
Expand Down

0 comments on commit b0e2645

Please sign in to comment.