Skip to content

Commit e01b816

Browse files
committed
improve: sass variable for width in switch field
1 parent 534c384 commit e01b816

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/fields/fieldSwitch.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
input(type="checkbox", v-model="value", :disabled="disabled")
44
span.label(:data-on="schema.textOn || 'On'", :data-off="schema.textOff || 'Off'")
55
span.handle
6-
span {{ this | json}}
76
</template>
87

98
<script>
@@ -16,11 +15,13 @@
1615

1716
<style lang="sass" scoped>
1817
18+
$width: 120px;
19+
1920
label {
2021
position: relative;
2122
display: block;
2223
vertical-align: top;
23-
width: 100px;
24+
width: $width;
2425
height: 30px;
2526
padding: 3px;
2627
margin: 0 10px 10px 0;
@@ -105,7 +106,7 @@
105106
box-shadow: inset 0 1px rgba(0, 0, 0, 0.02);
106107
}
107108
input:checked ~ .handle {
108-
left: 74px;
109+
left: $width - 26px;
109110
box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.2);
110111
}
111112

0 commit comments

Comments
 (0)