1
- button {
2
- outline :none ;
3
- }
4
-
5
- .nbutton {
6
- overflow :hidden ;
7
- min-width : 80px ;
8
- height : 36px ;
9
- padding : 0 15px ;
10
- background-color : #F7F7FA ;
11
- border-radius : 6px ;
12
- border : 0 ;
13
- text-align : center ;
14
- font-family : PingFangSC- Regular;
15
- font-size : 14px ;
16
- line-height : 36px ;
17
- cursor :pointer ;
18
- .nbutton-content {
19
- display : flex ;
20
- justify-content : center ;
21
- }
22
- .nbutton-icon {
1
+ @import ' ../theme/color.scss' ;
2
+ button {
3
+ outline : none ;
4
+ }
5
+
6
+ $xs :2px 8px ;
7
+ $sm :5px 10px ;
8
+ $md :8px 12px ;
9
+ $lg :10px 16px ;
10
+ .nbutton {
11
+ overflow : hidden ;
12
+ border-radius : 6px ;
13
+ border : 0 ;
14
+ text-align : center ;
15
+ font-family : PingFangSC- Regular;
23
16
display : inline-block ;
24
- margin-right : 8px ;
25
- }
17
+ position : relative ;
18
+ outline : none ;
19
+ font-weight : 400 ;
20
+ -webkit-appearance : none ;
21
+ user-select : none ;
22
+ cursor : pointer ;
23
+ white-space : nowrap ;
24
+ transition : all .1s linear ;
25
+ box-sizing : border-box ;
26
+ cursor : pointer ;
27
+ .nbutton-icon {
28
+ display : inline-block ;
29
+ margin-right : 8px ;
30
+ }
31
+ .nbutton-icon-only {
32
+ display : block ;
33
+ font-size : 12px ;
34
+ margin : 0 ;
35
+ height : 16px ;
36
+ width : 16px ;
37
+ }
38
+ }
39
+
40
+ .nbutton-hasicon {
41
+ padding : 10px !important ;
42
+ }
43
+
44
+ @mixin nbutton-colors ($color , $type ) {
45
+ background : $color ;
46
+ color : $color ;
47
+ @if $type == ' default' {
48
+ background : transparent ;
49
+ border : 1px solid $color ;
50
+ & :focus ,
51
+ & :hover {
52
+ background : mix ($white , $color , 90% );
53
+ border : 1px solid mix ($white , $color , 20% );
54
+ color : $color ;
55
+ }
56
+ }
57
+ @if $type == ' primary' {
58
+ border : none ;
59
+ color : $white ;
60
+ & :focus ,
61
+ & :hover {
62
+ background : mix ($white , $color , 30% )
63
+ }
64
+ ;
65
+ & :active {
66
+ background : mix ($black , $color , 5% )
67
+ }
68
+ & :disabled {
69
+ background : mix ($white , $color , 40% )
70
+ }
71
+ }
72
+ }
73
+
74
+ .nbutton-type-default {
75
+ @include nbutton-colors ($primaryColor , ' default' );
76
+ }
77
+
78
+ .nbutton-type-primary {
79
+ @include nbutton-colors ($primaryColor , ' primary' );
80
+ border : none ;
81
+ color : $white !important ;
82
+ }
83
+
84
+ .nbutton-type-link {
85
+ color : $primaryColor ;
86
+ background : none ;
87
+ border : none ;
88
+ }
89
+
90
+ .nbutton-type-ghost {
91
+ color : $primaryColor ;
92
+ background : #ffffff ;
93
+ border : 1px solid $primaryColor ;
26
94
}
27
95
28
- .default {
29
- color : #575757 ;
30
- & :focus ,& :hover {
31
- background : #E5E5EA ;
32
- };
33
- & :active {
34
- color : #272C36 ;
35
- background : #D9D9D9 ;
36
- }
96
+ .nbutton-type-delicate {
97
+ color : #8E8E93 ;
98
+ background : none ;
99
+ border : none ;
37
100
}
38
101
39
- .primary {
40
- background : #34C3FF ;
41
- color : #ffffff ;
42
- & :focus ,& :hover {
43
- background : #2EABDF ;
44
- };
45
- & :active {
46
- background : #2792BF ;;
47
- }
48
- & :disabled {
49
- background : #C2EDFF ;
50
- }
102
+ .nbutton-type-default.nbutton-status-success {
103
+ @include nbutton-colors ($successColor , ' default' );
51
104
}
52
105
53
- .link {
54
- color : #34C3FF ;
55
- background : none ;
56
- border : none ;
106
+ .nbutton-type-default.nbutton-status-info {
107
+ @include nbutton-colors ($infoColor , ' default' );
57
108
}
58
109
59
- .ghost {
60
- color : #34C3FF ;
61
- background : #ffffff ;
62
- border : 1px solid #34C3FF ;
110
+ .nbutton-type-default.nbutton-status-warning {
111
+ @include nbutton-colors ($warningColor , ' default' );
63
112
}
64
113
65
- .delicate {
66
- color : #8E8E93 ;
67
- background : none ;
68
- border : none ;
114
+ .nbutton-type-default.nbutton-status-danger {
115
+ @include nbutton-colors ($dangerColor , ' default' );
116
+ }
117
+
118
+ .nbutton-type-primary.nbutton-status-success {
119
+ @include nbutton-colors ($successColor , ' primary' );
120
+ }
121
+
122
+ .nbutton-type-primary.nbutton-status-info {
123
+ @include nbutton-colors ($infoColor , ' primary' );
124
+ }
125
+
126
+ .nbutton-type-primary.nbutton-status-warning {
127
+ @include nbutton-colors ($warningColor , ' primary' );
128
+ }
129
+
130
+ .nbutton-type-primary.nbutton-status-danger {
131
+ @include nbutton-colors ($dangerColor , ' primary' );
69
132
}
70
133
71
134
.nbutton-disabled {
72
- background-color : #F7F7FA ;
73
- cursor : not-allowed ;
74
- & :focus ,& :hover {
75
135
background-color : #F7F7FA ;
76
- outline : none ;
77
- }
136
+ cursor : not-allowed ;
137
+ & :focus ,
138
+ & :hover {
139
+ background-color : #F7F7FA ;
140
+ outline : none ;
141
+ }
142
+ }
143
+
144
+ .nbutton-shape-square {
145
+ border-radius : 6px ;
146
+ }
147
+
148
+ .nbutton-shape-circle {
149
+ border-radius : 50% ;
150
+ padding : 0 ;
151
+ }
152
+
153
+ .nbutton-shape-round {
154
+ border-radius : 18px ;
78
155
}
79
156
80
- .lg {
81
- width : 96px ;
82
- height : 24px ;
83
- font-size : 16px ;
84
- padding : 10px 16px ;
157
+ .nbutton-size-lg {
158
+ padding : $lg ;
159
+ font-size : 16px ;
85
160
}
86
161
87
- .md {
88
- width : 80px ;
89
- height : 36px ;
90
- font-size : 14px ;
91
- padding : 8px 12px ;
162
+ .nbutton-size-md {
163
+ padding : $md ;
164
+ font-size : 14px ;
92
165
}
93
166
94
- .sm {
95
- width : 76px ;
96
- height : 30px ;
97
- font-size : 14px ;
98
- padding : 5px 10px ;
167
+ .nbutton-size-sm {
168
+ padding : $sm ;
169
+ font-size : 14px ;
99
170
}
100
171
101
- .xs {
102
- width : 64px ;
103
- height : 24px ;
104
- font-size : 12px ;
105
- padding : 2px 8px ;
172
+ .nbutton-size-xs {
173
+ padding : $xs ;
174
+ font-size : 12px ;
106
175
}
107
176
108
- .nbutton-slot {
109
- text-align : center ;
177
+ .nbutton-slot {
178
+ text-align : center ;
110
179
}
0 commit comments