From 261979ac84ca23e398d8b03ac6fd9fb88b7656d9 Mon Sep 17 00:00:00 2001 From: Shail Mehta Date: Thu, 26 Dec 2024 08:52:12 +0530 Subject: [PATCH] Post Template: Add Border and Spacing Support (#64425) * Post Template: Add Border and Spacing Support * fix conflict issue * Added Border & Spacing Controls Optional * fix conflict issue * Fixed Lint Issue * Added Suggested Changes * Added Suggested Changes * Added Suggested Changes * Added Suggested Changes Co-authored-by: shail-mehta Co-authored-by: aaronrobertshaw Co-authored-by: t-hamano Co-authored-by: paaljoachim Co-authored-by: shimotmk Co-authored-by: jameskoster Co-authored-by: jasmussen --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/editor.scss | 1 - packages/block-library/src/post-template/block.json | 12 +++++++++++- packages/block-library/src/post-template/editor.scss | 7 ------- packages/block-library/src/post-template/style.scss | 2 ++ 5 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 packages/block-library/src/post-template/editor.scss diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 7e031fa525e1ff..0715b1e3547e2a 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -661,7 +661,7 @@ Contains the block elements used to render a post, like the title, date, feature - **Name:** core/post-template - **Category:** theme - **Ancestor:** core/query -- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ ## Post Terms diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index a16d5a6c2c69c7..34be4387caad74 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -49,7 +49,6 @@ @import "./template-part/editor.scss"; @import "./text-columns/editor.scss"; @import "./video/editor.scss"; -@import "./post-template/editor.scss"; @import "./query/editor.scss"; @import "./query-pagination/editor.scss"; @import "./query-pagination-numbers/editor.scss"; diff --git a/packages/block-library/src/post-template/block.json b/packages/block-library/src/post-template/block.json index 6e1f58155590f3..57664b271bca46 100644 --- a/packages/block-library/src/post-template/block.json +++ b/packages/block-library/src/post-template/block.json @@ -43,15 +43,25 @@ } }, "spacing": { + "margin": true, + "padding": true, "blockGap": { "__experimentalDefault": "1.25em" }, "__experimentalDefaultControls": { - "blockGap": true + "blockGap": true, + "padding" : false, + "margin" : false } }, "interactivity": { "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true } }, "style": "wp-block-post-template", diff --git a/packages/block-library/src/post-template/editor.scss b/packages/block-library/src/post-template/editor.scss deleted file mode 100644 index 7b426b0f3d37a5..00000000000000 --- a/packages/block-library/src/post-template/editor.scss +++ /dev/null @@ -1,7 +0,0 @@ -.editor-styles-wrapper { - ul.wp-block-post-template { - padding-left: 0; - margin-left: 0; - list-style: none; - } -} diff --git a/packages/block-library/src/post-template/style.scss b/packages/block-library/src/post-template/style.scss index 806aadc77470eb..e6896f2db024a8 100644 --- a/packages/block-library/src/post-template/style.scss +++ b/packages/block-library/src/post-template/style.scss @@ -4,6 +4,8 @@ max-width: 100%; list-style: none; padding: 0; + // This block has customizable padding, border-box makes that more predictable. + box-sizing: border-box; // These rules no longer apply but should be kept for backwards compatibility. &.is-flex-container {