-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
/
VSwitch.sass
132 lines (105 loc) 路 3.49 KB
/
VSwitch.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@import './_variables.scss'
// Theme
+theme(v-input--switch) using ($material)
.v-input--switch__thumb
color: map-deep-get($material, 'selection-controls', 'thumb', 'inactive')
.v-input--switch__track
color: map-deep-get($material, 'selection-controls', 'track', 'inactive')
&.v-input--is-disabled:not(.v-input--is-dirty)
.v-input--switch__thumb
color: map-deep-get($material, 'selection-controls', 'thumb', 'disabled') !important
.v-input--switch__track
color: map-deep-get($material, 'selection-controls', 'track', 'disabled') !important
.v-input--switch
&__track,
&__thumb
background-color: currentColor
pointer-events: none
transition: inherit
&__track
border-radius: $switch-track-border-radius
width: $switch-track-width
height: $switch-track-height
left: $switch-track-x
position: absolute
opacity: $switch-track-opacity
right: $switch-track-x
top: $switch-track-top
&__thumb
border-radius: 50%
top: $switch-thumb-top
height: $switch-thumb-height
position: relative
width: $switch-thumb-width
display: flex
justify-content: center
align-items: center
transition: $primary-transition
.v-input--selection-controls__input
width: $switch-width
.v-input--selection-controls__ripple
top: $switch-ripple-top
&.v-input--dense
.v-input--switch__thumb
width: $switch-thumb-dense-width
height: $switch-thumb-dense-height
.v-input--switch__track
height: $switch-track-dense-height
width: $switch-track-dense-width
&.v-input--switch--inset
.v-input--switch__track
height: $switch-track-dense-inset-height
width: $switch-track-dense-inset-width
top: $switch-track-dense-top
left: -3px
.v-input--selection-controls__ripple
top: $switch-ripple-dense-top
&.v-input--is-dirty
&.v-input--is-disabled
opacity: $switch-disabled-opacity
+ltr()
.v-input--selection-controls__ripple
left: $switch-ripple-x
&.v-input--dense
.v-input--selection-controls__ripple
left: $switch-ripple-dense-x
&.v-input--is-dirty
.v-input--selection-controls__ripple,
.v-input--switch__thumb
transform: translate($switch-dirty-offset-x, 0)
+rtl()
.v-input--selection-controls__ripple
right: $switch-ripple-x
&.v-input--dense
.v-input--selection-controls__ripple
right: $switch-ripple-dense-x
&.v-input--is-dirty
.v-input--selection-controls__ripple,
.v-input--switch__thumb
transform: translate(-$switch-dirty-offset-x, 0)
&:not(&--flat):not(&--inset)
.v-input--switch__thumb
+elevation($switch-thumb-elevation)
&--inset
.v-input--switch__track,
.v-input--selection-controls__input
width: $switch-track-inset-width
.v-input--switch__track
border-radius: $switch-track-inset-border-radius
height: $switch-track-inset-height
left: -4px
opacity: $switch-track-inset-opacity
top: calc(50% - #{$switch-track-inset-height} / 2)
.v-input--selection-controls__ripple,
.v-input--switch__thumb
+ltr()
transform: translate(0, 0) !important
+rtl()
transform: translate(-6px, 0) !important
&.v-input--is-dirty
.v-input--selection-controls__ripple,
.v-input--switch__thumb
+ltr()
transform: translate($switch-dirty-offset-x, 0) !important
+rtl()
transform: translate(-$switch-dirty-offset-x - 6px, 0) !important