radio-button.scss
2.91 KB
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
@import "mixins/mixins";
@import "mixins/_button";
@import "common/var";
@include b(radio-button) {
position: relative;
display: inline-block;
outline: none;
@include e(inner) {
display: inline-block;
line-height: 1;
white-space: nowrap;
vertical-align: middle;
background: $--button-default-background-color;
border: $--border-base;
font-weight: $--button-font-weight;
border-left: 0;
color: $--button-default-font-color;
-webkit-appearance: none;
text-align: center;
box-sizing: border-box;
outline: none;
margin: 0;
position: relative;
cursor: pointer;
transition: $--all-transition;
@include button-size($--button-padding-vertical, $--button-padding-horizontal, $--button-font-size, 0);
&:hover {
color: $--color-primary;
}
& [class*="el-icon-"] {
line-height: 0.9;
& + span {
margin-left: 5px;
}
}
}
&:first-child {
.el-radio-button__inner {
border-left: $--border-base;
border-radius: $--border-radius-base 0 0 $--border-radius-base;
box-shadow: none !important;
}
}
@include e(orig-radio) {
opacity: 0;
outline: none;
position: absolute;
z-index: -1;
&:checked {
& + .el-radio-button__inner {
color: $--radio-button-checked-font-color;
background-color: $--radio-button-checked-background-color;
border-color: $--radio-button-checked-border-color;
box-shadow: -1px 0 0 0 $--radio-button-checked-border-color;
}
}
&:disabled {
& + .el-radio-button__inner {
color: $--button-disabled-font-color;
cursor: not-allowed;
background-image: none;
background-color: $--button-disabled-background-color;
border-color: $--button-disabled-border-color;
box-shadow: none;
}
&:checked + .el-radio-button__inner {
background-color: $--radio-button-disabled-checked-fill;
}
}
}
&:last-child {
.el-radio-button__inner {
border-radius: 0 $--border-radius-base $--border-radius-base 0;
}
}
&:first-child:last-child {
.el-radio-button__inner {
border-radius: $--border-radius-base;
}
}
@include m(medium) {
& .el-radio-button__inner {
@include button-size($--button-medium-padding-vertical, $--button-medium-padding-horizontal, $--button-medium-font-size, 0);
}
}
@include m(small) {
& .el-radio-button__inner {
@include button-size($--button-small-padding-vertical, $--button-small-padding-horizontal, $--button-small-font-size, 0);
}
}
@include m(mini) {
& .el-radio-button__inner {
@include button-size($--button-mini-padding-vertical, $--button-mini-padding-horizontal, $--button-mini-font-size, 0);
}
}
&:focus:not(.is-focus):not(:active):not(.is-disabled){ /*获得焦点时 样式提醒*/
box-shadow: 0 0 2px 2px $--radio-button-checked-border-color;
}
}