From 4134d411112d045c3abf847f96465108df719256 Mon Sep 17 00:00:00 2001 From: Nick Diego Date: Fri, 26 Aug 2022 11:48:20 -0500 Subject: [PATCH] Add spacing support to the Categories block. --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/categories/block.json | 4 ++++ packages/block-library/src/categories/style.scss | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 3d2f9a11f91a2..5c547caeee4b5 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -77,7 +77,7 @@ Display a list of all categories. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/categories - **Category:** widgets -- **Supports:** align, typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayAsDropdown, showEmpty, showHierarchy, showOnlyTopLevel, showPostCounts ## Code diff --git a/packages/block-library/src/categories/block.json b/packages/block-library/src/categories/block.json index c24641655899a..adf28dc42b4f0 100644 --- a/packages/block-library/src/categories/block.json +++ b/packages/block-library/src/categories/block.json @@ -31,6 +31,10 @@ "supports": { "align": true, "html": false, + "spacing": { + "margin": true, + "padding": true + }, "typography": { "fontSize": true, "lineHeight": true, diff --git a/packages/block-library/src/categories/style.scss b/packages/block-library/src/categories/style.scss index 0b5eeafd989ea..8cf1252800b43 100644 --- a/packages/block-library/src/categories/style.scss +++ b/packages/block-library/src/categories/style.scss @@ -1,4 +1,7 @@ .wp-block-categories { + // This block has customizable padding, border-box makes that more predictable. + box-sizing: border-box; + &.alignleft { /*rtl:ignore*/ margin-right: 2em;