From ba5b9b2932e503c85b8328fe9b56d1e058182013 Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Fri, 9 Aug 2024 15:07:55 +0530 Subject: [PATCH] Move custom block variations styles to theme.json --- .../styles/blocks/button/styles/_dark.scss | 18 ++++++------- wp-content/themes/humanity-theme/theme.json | 25 +++++++++++++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/private/src/styles/blocks/button/styles/_dark.scss b/private/src/styles/blocks/button/styles/_dark.scss index 177ed4d9..a75a648f 100644 --- a/private/src/styles/blocks/button/styles/_dark.scss +++ b/private/src/styles/blocks/button/styles/_dark.scss @@ -2,14 +2,14 @@ .wp-block-button.is-style-dark .wp-block-button__link, .btn--dark, .btn.is-style-dark { - border: 1px solid $color-black; - background: $color-black; - color: $color-white; + // border: 1px solid $color-black; + // background: $color-black; + // color: $color-white; - &:hover, - &:focus { - background-color: $color-white; - border-color: $color-black; - color: $color-black; - } + // &:hover, + // &:focus { + // background-color: $color-white; + // border-color: $color-black; + // color: $color-black; + // } } diff --git a/wp-content/themes/humanity-theme/theme.json b/wp-content/themes/humanity-theme/theme.json index 3dce2fb1..88b50753 100644 --- a/wp-content/themes/humanity-theme/theme.json +++ b/wp-content/themes/humanity-theme/theme.json @@ -255,6 +255,31 @@ "bottom": "0px", "left": "2rem" } + }, + "blocks": { + "core/button": { + "variations": { + "dark": { + "color": { + "background": "black", + "text": "white" + }, + "border": { + "color": "black", + "width": "1px" + }, + ":hover": { + "color": { + "background": "white", + "text": "black" + }, + "border": { + "color": "black" + } + } + } + } + } } }, "templateParts": [