Skip to content

Commit

Permalink
Added block and spacing support for RSS block
Browse files Browse the repository at this point in the history
  • Loading branch information
benazeer-ben committed Oct 24, 2024
1 parent 4b56a4a commit 11696c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/rss/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"width": true,
"style": true
}
},
"spacing": {
"margin": true,
"padding": true
}
},
"editorStyle": "wp-block-rss-editor",
Expand Down
11 changes: 9 additions & 2 deletions packages/block-library/src/rss/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ export default function RSSEdit( { attributes, setAttributes } ) {
isActive: blockLayout === 'grid',
},
];

const serverSideAttributes = {
...attributes,
style: {
...attributes?.style,
border: undefined,
spacing:undefined
},
};
return (
<>
<BlockControls>
Expand Down Expand Up @@ -189,7 +196,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
<Disabled>
<ServerSideRender
block="core/rss"
attributes={ attributes }
attributes={ serverSideAttributes }
/>
</Disabled>
</div>
Expand Down
7 changes: 7 additions & 0 deletions packages/block-library/src/rss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ ul.wp-block-rss { // The ul is needed for specificity to override the reset styl
display: block;
font-size: 0.8125em;
}
.wp-block-rss {
box-sizing: border-box;
.wp-block-rss {
margin: 0;
border: 0;
}
}

0 comments on commit 11696c1

Please sign in to comment.