Skip to content

Commit

Permalink
fix(Button): size fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VadymBezpalko committed Dec 18, 2023
1 parent 8c97b4d commit 68eadd6
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/react-components/src/components/Button/styles/size.scss
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
@mixin size($paddingV, $paddingH, $min-width, $height) {
$compact-size: 32px;
$medium-size: 36px;
$large-size: 44px;

@mixin size($paddingV, $paddingH, $element-size) {
padding: $paddingV $paddingH;
min-width: $min-width;
min-height: $height;
min-width: $element-size;
min-height: $element-size;

&.#{$base-class}--icon-only {
padding: 6px;
}
}

@mixin button-compact($with-border: false) {
@if ($with-border) {
@include size(5px, 16px, 32px, 32px);
@include size(5px, 16px, $compact-size);
}

@else {
@include size(6px, 16px, 32px, 32px);
@include size(6px, 16px, $compact-size);
}
}

@mixin button-medium($with-border: false) {
@if ($with-border) {
@include size(calc(var(--spacing-2) - 1px), 16px, 32px, 32px);
@include size(calc(var(--spacing-2) - 1px), 16px, $medium-size);
}

@else {
@include size(var(--spacing-2), 16px, 36px, 36px);
@include size(var(--spacing-2), 16px, $medium-size);
}
}

@mixin button-large($with-border: false) {
@if ($with-border) {
@include size(calc(var(--spacing-3) - 1px), 16px, 44px, 44px);
@include size(calc(var(--spacing-3) - 1px), 16px, $large-size);
}

@else {
@include size(var(--spacing-3), 16px, 44px, 44px);
@include size(var(--spacing-3), 16px, $large-size);
}
}

Expand All @@ -46,8 +54,4 @@
&.#{$base-class}--large {
@include button-large($with-border);
}

&.#{$base-class}--icon-only {
padding: 6px;
}
}

0 comments on commit 68eadd6

Please sign in to comment.