Skip to content

Commit 834b555

Browse files
committed
Add token allowing to manage slider and label alignment
1 parent ed022fd commit 834b555

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

projects/pastanaga-angular/src/lib/controls/toggles/toggle/toggle.component.scss

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ $toggle-mid-width: math.div($width-toggle, 2);
55
$toggle-transition-duration: $duration-fast;
66

77
.pa-field {
8-
flex-direction: row;
9-
justify-content: space-between;
10-
118
.pa-toggle-context {
129
display: flex;
1310
gap: rhythm(2);
@@ -42,17 +39,18 @@ $toggle-transition-duration: $duration-fast;
4239

4340
&.pa-has-help {
4441
.pa-field-label {
45-
margin-top: -#{rhythm(0.5)};
42+
margin-top: $margin-top-toggle-with-help-label;
4643
}
4744
}
4845
}
4946

5047
.pa-toggle-container {
48+
box-sizing: border-box;
49+
height: $height-toggle;
50+
margin: $margin-toggle-container;
51+
min-width: $width-toggle;
5152
position: relative;
5253
width: $width-toggle;
53-
min-width: $width-toggle;
54-
height: $height-toggle;
55-
box-sizing: border-box;
5654

5755
input {
5856
outline: 0;

projects/pastanaga-angular/src/styles/theme/_toggle.tokens.scss

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ $gap-radio-group: rhythm(1) !default;
4141
$height-toggle: rhythm(3) !default;
4242
$width-toggle: rhythm(6) !default;
4343
$padding-toggle-slider: rhythm(0.25) !default;
44+
$margin-toggle-container: 0 !default;
45+
$margin-top-toggle-with-help-label: -#{rhythm(0.5)} !default;
4446

4547
//=====================================
4648
// TYPOGRAPHY

0 commit comments

Comments
 (0)