From 36f9d013be9151df182b2992ee60b7cbc1f1af02 Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Thu, 9 Nov 2023 16:45:36 +0000 Subject: [PATCH 1/5] feat: update button block --- src/scss/blocks/_blocks.scss | 1 + src/scss/blocks/_button.scss | 19 +++++++++++++++++++ theme.json | 24 +++++++++++++++++++----- 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/scss/blocks/_button.scss diff --git a/src/scss/blocks/_blocks.scss b/src/scss/blocks/_blocks.scss index 87e087ef..e7a8b427 100644 --- a/src/scss/blocks/_blocks.scss +++ b/src/scss/blocks/_blocks.scss @@ -1,3 +1,4 @@ +@import url('./_button.scss'); @import url('./_columns.scss'); @import url('./_homepage-posts.scss'); @import url('./_navigation.scss'); diff --git a/src/scss/blocks/_button.scss b/src/scss/blocks/_button.scss new file mode 100644 index 00000000..597efb23 --- /dev/null +++ b/src/scss/blocks/_button.scss @@ -0,0 +1,19 @@ +.has-x-small-font-size { + .wp-block-button { + &__link { + padding: 0.5rem 1.5rem; + } + + &.is-style-outline { + .wp-block-button__link { + padding: calc(0.5rem - 1.5px) calc(1.5rem - 1.5px); + } + } + } + + .wp-block-button, + &.wp-block-button { + font-size: var(--wp--preset--font-size--small) !important; + line-height: var(--wp--custom--line-height--small); + } +} diff --git a/theme.json b/theme.json index 4dd781fd..ce3be249 100644 --- a/theme.json +++ b/theme.json @@ -184,6 +184,17 @@ "styles": { "blocks": { "core/button": { + "spacing": { + "padding": { + "bottom": "0.75rem", + "left": "2.25rem", + "right": "2.25rem", + "top": "0.75rem" + } + }, + "typography": { + "lineHeight": "inherit" + }, "variations": { "outline": { "border": { @@ -194,10 +205,10 @@ }, "spacing": { "padding": { - "bottom": "calc( 0.375rem - 1.5px )", - "left": "calc( 1.125rem - 1.5px )", - "right": "calc( 1.125rem - 1.5px )", - "top": "calc( 0.375rem - 1.5px )" + "bottom": "calc( 0.75rem - 1.5px )", + "left": "calc( 2.25rem - 1.5px )", + "right": "calc( 2.25rem - 1.5px )", + "top": "calc( 0.75rem - 1.5px )" } } } @@ -229,7 +240,10 @@ }, "core/columns": { "spacing": { - "blockGap": "var( --wp--preset--spacing--50 )" + "blockGap": "var( --wp--preset--spacing--50 )", + "margin": { + "bottom": "var( --wp--preset--spacing--50 )" + } } }, "core/comment-author-name": { From 341f16b18b13ed3a2085b268a7fd0850b03ebe3d Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Thu, 9 Nov 2023 16:53:45 +0000 Subject: [PATCH 2/5] feat: update desktop-header template --- parts/desktop-header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parts/desktop-header.html b/parts/desktop-header.html index af6b9229..5f712902 100644 --- a/parts/desktop-header.html +++ b/parts/desktop-header.html @@ -11,8 +11,8 @@ - From a7a97703bbfbe40fe5b737d01cc69584f79d62f7 Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Thu, 9 Nov 2023 16:56:15 +0000 Subject: [PATCH 3/5] feat: update mobile-header template --- parts/mobile-header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parts/mobile-header.html b/parts/mobile-header.html index ee572684..86df7f3d 100644 --- a/parts/mobile-header.html +++ b/parts/mobile-header.html @@ -12,8 +12,8 @@
-
From b67b0eed2f719989215f7df045ebd2ce9dc65d26 Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Thu, 9 Nov 2023 17:04:35 +0000 Subject: [PATCH 4/5] fix: add missing font-weight --- theme.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/theme.json b/theme.json index ce3be249..6e443b4f 100644 --- a/theme.json +++ b/theme.json @@ -217,6 +217,9 @@ "core/buttons": { "spacing": { "blockGap": "var( --wp--preset--spacing--30 )" + }, + "typography": { + "fontWeight": "500" } }, "core/code": { From eab79331083561b9c4e3bc021cd2f292a90c8544 Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Fri, 17 Nov 2023 10:42:08 +0000 Subject: [PATCH 5/5] fix: padding when button is using x-small and outline --- src/scss/blocks/_button.scss | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/scss/blocks/_button.scss b/src/scss/blocks/_button.scss index 597efb23..750fd8cd 100644 --- a/src/scss/blocks/_button.scss +++ b/src/scss/blocks/_button.scss @@ -3,12 +3,6 @@ &__link { padding: 0.5rem 1.5rem; } - - &.is-style-outline { - .wp-block-button__link { - padding: calc(0.5rem - 1.5px) calc(1.5rem - 1.5px); - } - } } .wp-block-button, @@ -16,4 +10,11 @@ font-size: var(--wp--preset--font-size--small) !important; line-height: var(--wp--custom--line-height--small); } -} + + .is-style-outline, + &.is-style-outline { + .wp-block-button__link { + padding: calc(0.5rem - 1.5px) calc(1.5rem - 1.5px) !important; + } + } +} \ No newline at end of file