Skip to content

Commit

Permalink
optimice sass
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchox5 committed Jun 8, 2023
1 parent da33592 commit c7822fd
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/components/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,36 @@
@include alignment;
}

@each $size,
$var in $sizes {
.item>.label {
transform: rotate(var(--label-angle)) translate(var(--x), 0);
}

@each $pos,
$angle in $position {
.item.#{$size}>.label.#{$pos} {
transform: rotate(calc(#{$angle} * 1deg)) translate(calc(#{$var} / 1.8), 0);
}
}
}
.label>.label__text {
transform: translate(calc(var(--connector-width) - 5px), var(--label-box)) rotate(var(--label-angle-invert));
}

@each $size,
$var in $sizes {

@each $pos,
$angle in $position {
.item.#{$size}>.label.#{$pos} {
--label-angle: calc(#{$angle} * 1deg);
--x: calc(#{$var} / 1.8);
}
}
}

@each $pos,
$angle in $position {
.label.#{$pos}>.label__text {
--label-angle-invert: calc(#{$angle} * -1deg);
@if $pos !="pos-180" {
transform: translate(calc(var(--connector-width) - 5px), -5px) rotate(calc(#{$angle} * -1deg));
--label-box: -5px;
}

@else {
transform: translate(calc(var(--connector-width) + var(--label-width)), +5px) rotate(calc(#{$angle} * -1deg));
--label-box: -5px;
}

}
Expand Down

0 comments on commit c7822fd

Please sign in to comment.