Skip to content

Commit

Permalink
[#102] Removing parent wp-block class from button css (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget authored Jun 17, 2024
1 parent 0847df9 commit 3a7d918
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion wp-content/themes/wp-starter/plugins-tailwind/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = plugin.withOptions(function (options = {}) {
...base,
[`@apply
bg-${accentColor}-700 text-white
hover:bg-${accentColor}-700
hover:bg-${accentColor}-800
active:bg-${accentColor}-800
focus-visible:bg-${accentColor}-700 focus-visible:ring-${accentColor}-600/50`]: {},
},
Expand Down
35 changes: 16 additions & 19 deletions wp-content/themes/wp-starter/src/styles/core-blocks/buttons.css
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
@layer components {
.wp-block,
.acf-block {
.wp-block-button {
.wp-block-button {
.wp-block-button__link {
@apply btn-contained;
}

&.is-style-outline {
.wp-block-button__link {
@apply btn-contained;
@apply btn-outlined;
}
}
}

&.is-style-outline {
.wp-block-button__link {
@apply btn-outlined;
}
/* Light versions for dark mode*/
[class*='has-dark'] {
.wp-block-button {
.wp-block-button__link {
@apply btn-contained-light;
}
}

/* Light versions for dark mode*/
&[class*='has-dark'] {
.wp-block-button {
&.is-style-outline {
.wp-block-button__link {
@apply btn-contained-light;
}

&.is-style-outline {
.wp-block-button__link {
@apply btn-outlined-light;
}
@apply btn-outlined-light;
}
}
}
Expand Down

0 comments on commit 3a7d918

Please sign in to comment.