Skip to content

Commit

Permalink
chore(component): refactored the styles
Browse files Browse the repository at this point in the history
  • Loading branch information
alionazherdetska committed Nov 13, 2024
1 parent 309dccf commit fbd79bb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions packages/styles/src/elements/segmented-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ $gap: tokens.get('button-segmented-gap-inline');
width: 100%;
margin: 0;
position: relative;
box-sizing: border-box;
border-radius: tokens.get('button-segmented-horizontal-border-radius');
border: tokens.get('button-segmented-border-width') solid tokens.get('button-segmented-enabled-border');
transition: all 0.4s cubic-bezier(0.25, 1.5, 0.5, 1.0);
Expand Down Expand Up @@ -67,9 +68,10 @@ $gap: tokens.get('button-segmented-gap-inline');
position: relative;
padding-inline: tokens.get('post-button-segmented-padding-inline');
height: tokens.get('button-segmented-elements-height');
z-index: 2;
z-index: 100;
font-weight: 500;
transition: inherit;
border: tokens.get('button-segmented-border-width') solid tokens.get('button-segmented-enabled-border');
}

.segmented-button input:checked + label {
Expand Down Expand Up @@ -146,6 +148,12 @@ $gap: tokens.get('button-segmented-gap-inline');
}

@container segmented-container (min-width: 501px) {
.segmented-button {
align-items: center;
height: tokens.get('button-segmented-elements-height');
justify-content: center;
}

.segmented-button input:checked + label:last-of-type::after {
opacity: 1;
transform: scaleX(1);
Expand All @@ -162,6 +170,16 @@ $gap: tokens.get('button-segmented-gap-inline');
.segmented-button label {
border-radius: tokens.get('button-segmented-horizontal-border-radius');
border: tokens.get('button-segmented-border-width') solid transparent;
margin-inline: calc($border-width * -2);
margin-block: calc($border-width * -2);

&:first-of-type {
margin-left: calc($border-width * -2);
}

&:last-of-type {
margin-right: calc($border-width * -2);
}

&:hover {
border-color: tokens.get('button-segmented-hover-border');
Expand All @@ -171,8 +189,7 @@ $gap: tokens.get('button-segmented-gap-inline');
border-color: tokens.get('button-segmented-enabled-border');
}
}

}
.segmented-button input:checked + label {
border: none;
}
}

0 comments on commit fbd79bb

Please sign in to comment.