Further improve button class on wp-block-button

This commit is contained in:
Tetrakern 2024-03-03 22:44:12 +01:00
parent 828b0d531e
commit 4e44866155
4 changed files with 27 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -94,6 +94,8 @@
}
%button {
--this-padding-horizontal: #{get_clamp(6, 8, 375, 480)};
--this-height: #{get_clamp(26, 32, 320, 375)};
cursor: pointer;
user-select: none;
-webkit-appearance: none;
@ -111,8 +113,8 @@
text-shadow: none;
border: var(--button-primary-border, 1px solid transparent);
border-radius: var(--layout-border-radius-small);
padding: 0 get_clamp(6, 8, 375, 480);
height: get_clamp(26, 32, 320, 375);
padding: 0 var(--this-padding-horizontal);
height: var(--this-height);
width: fit-content;
min-width: get_clamp(26, 32, 320, 375);
box-shadow: var(--button-box-shadow);

View File

@ -568,9 +568,29 @@ figure.wp-block-pullquote {
// Theme button style applied
&.button {
display: inline-flex;
padding-left: 0 !important;
padding-right: 0 !important;
height: auto;
a {
padding: 0 !important;
flex: 1 1 auto;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
text-align: center;
white-space: normal;
padding-top: 0 !important;
padding-bottom: 0 !important;
min-height: calc(var(--this-height) - 2px); // Subtract default border
&:not([style*="padding-left"]) {
padding-left: var(--this-padding-horizontal);
}
&:not([style*="padding-right"]) {
padding-right: var(--this-padding-horizontal);
}
}
}
}