1
1
@use ' sass:math' ;
2
2
@import ' ../../../../styles/variables' ;
3
3
4
- $toggle-full-width : rhythm (6 );
5
- $toggle-full-mid-width : math .div ($toggle-full-width , 2 );
6
- $toggle-full-height : rhythm (3 );
7
- $toggle-slider-padding : rhythm (0.25 );
4
+ $toggle-mid-width : math .div ($width-toggle , 2 );
8
5
$toggle-transition-duration : $duration-fast ;
9
6
10
7
.pa-field {
@@ -52,9 +49,9 @@ $toggle-transition-duration: $duration-fast;
52
49
53
50
.pa-toggle-container {
54
51
position : relative ;
55
- width : $toggle-full- width ;
56
- min-width : $toggle-full- width ;
57
- height : $toggle-full- height ;
52
+ width : $width-toggle ;
53
+ min-width : $width-toggle ;
54
+ height : $height-toggle ;
58
55
box-sizing : border-box ;
59
56
60
57
input {
@@ -63,8 +60,8 @@ $toggle-transition-duration: $duration-fast;
63
60
}
64
61
65
62
.pa-toggle-checkbox {
66
- width : $toggle-full- width ;
67
- height : $toggle-full- height ;
63
+ width : $width-toggle ;
64
+ height : $height-toggle ;
68
65
opacity : 0 ;
69
66
}
70
67
.pa-toggle-slider {
@@ -74,28 +71,28 @@ $toggle-transition-duration: $duration-fast;
74
71
bottom : 0 ;
75
72
left : 0 ;
76
73
transition : $toggle-transition-duration ;
77
- border-radius : $toggle-full- height ;
78
- background : $color-neutral-lighter ;
74
+ border-radius : $height-toggle ;
75
+ background : $color-background-toggle-slider ;
79
76
cursor : pointer ;
80
77
& :before {
81
78
content : ' ' ;
82
79
position : absolute ;
83
80
border-radius : 50% ;
84
81
transition : $toggle-transition-duration ;
85
- top : $toggle-slider-padding ;
86
- right : $toggle-full- mid-width + $toggle-slider-padding ;
87
- bottom : $toggle-slider-padding ;
88
- left : $toggle-slider-padding ;
82
+ top : $padding- toggle-slider ;
83
+ right : $toggle-mid-width + $padding- toggle-slider ;
84
+ bottom : $padding- toggle-slider ;
85
+ left : $padding- toggle-slider ;
89
86
box-shadow : 0 rhythm (0.25 ) rhythm (0.5 ) rgba (0 , 0 , 0 , 0.15 );
90
- background-color : $color-light-stronger ;
87
+ background-color : $color-background-toggle-button ;
91
88
}
92
89
}
93
90
94
91
& .pa-checked {
95
92
.pa-toggle-slider {
96
- background : $color-primary-regular ;
93
+ background : $color-background-toggle-slider-selected ;
97
94
& :before {
98
- transform : translateX ($toggle-full- mid-width );
95
+ transform : translateX ($toggle-mid-width );
99
96
}
100
97
}
101
98
}
@@ -107,9 +104,9 @@ $toggle-transition-duration: $duration-fast;
107
104
& .pa-disable {
108
105
.pa-toggle-slider {
109
106
cursor : default ;
110
- background : $color-neutral-light ;
107
+ background : $color-background-toggle-slider-disabled ;
111
108
& :before {
112
- background-color : $color-neutral-lighter ;
109
+ background-color : $color-background-toggle-button-disabled ;
113
110
}
114
111
}
115
112
}
0 commit comments