Skip to content

Commit 93176b3

Browse files
committed
fix(radio): replace 'outline' with 'box-shadow'
Closes vueComponent#3671
1 parent c2449f5 commit 93176b3

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

components/radio/style/index.less

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
@radio-group-prefix-cls: ~'@{radio-prefix-cls}-group';
66
@radio-inner-prefix-cls: ~'@{radio-prefix-cls}-inner';
77
@radio-duration: 0.3s;
8-
@radio-focused-outline: 3px solid fade(@radio-dot-color, 6%);
8+
// @radio-button-focus-shadow: 3px solid fade(@radio-dot-color, 6%);
9+
@radio-focus-shadow: 0 0 0 3px fade(@radio-dot-color, 8%);
10+
@radio-button-focus-shadow: @radio-focus-shadow;
911

1012
.@{radio-group-prefix-cls} {
1113
.reset-component;
@@ -42,7 +44,7 @@
4244
}
4345

4446
&-input:focus + .@{radio-inner-prefix-cls} {
45-
box-shadow: 0 0 0 3px fade(@radio-dot-color, 8%);
47+
box-shadow: @radio-focus-shadow;
4648
}
4749

4850
&-checked::after {
@@ -162,7 +164,7 @@ span.@{radio-prefix-cls} + * {
162164
border-top-width: @border-width-base + 0.02px;
163165
border-left: 0;
164166
cursor: pointer;
165-
transition: color 0.3s, background 0.3s, border-color 0.3s;
167+
transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
166168

167169
a {
168170
color: @radio-button-color;
@@ -190,12 +192,15 @@ span.@{radio-prefix-cls} + * {
190192
&:not(:first-child) {
191193
&::before {
192194
position: absolute;
193-
top: 0;
195+
top: @border-width-base * -1;
194196
left: -1px;
195197
display: block;
198+
box-sizing: content-box;
196199
width: 1px;
197200
height: 100%;
201+
padding: @border-width-base 0;
198202
background-color: @border-color-base;
203+
transition: background-color 0.3s;
199204
content: '';
200205
}
201206
}
@@ -218,7 +223,7 @@ span.@{radio-prefix-cls} + * {
218223
}
219224

220225
&:focus-within {
221-
outline: @radio-focused-outline;
226+
box-shadow: @radio-button-focus-shadow;
222227
}
223228

224229
.@{radio-prefix-cls}-inner,
@@ -235,32 +240,33 @@ span.@{radio-prefix-cls} + * {
235240
color: @radio-dot-color;
236241
background: @radio-button-checked-bg;
237242
border-color: @radio-dot-color;
238-
box-shadow: -1px 0 0 0 @radio-dot-color;
239243

240244
&::before {
241-
background-color: @radio-dot-color !important;
242-
opacity: 0.1;
245+
background-color: @radio-dot-color;
243246
}
244247

245248
&:first-child {
246249
border-color: @radio-dot-color;
247-
box-shadow: none !important;
248250
}
249251

250252
&:hover {
251253
color: @radio-button-hover-color;
252254
border-color: @radio-button-hover-color;
253-
box-shadow: -1px 0 0 0 @radio-button-hover-color;
255+
&::before {
256+
background-color: @radio-button-hover-color;
257+
}
254258
}
255259

256260
&:active {
257261
color: @radio-button-active-color;
258262
border-color: @radio-button-active-color;
259-
box-shadow: -1px 0 0 0 @radio-button-active-color;
263+
&::before {
264+
background-color: @radio-button-active-color;
265+
}
260266
}
261267

262268
&:focus-within {
263-
outline: @radio-focused-outline;
269+
box-shadow: @radio-button-focus-shadow;
264270
}
265271
}
266272

@@ -279,7 +285,7 @@ span.@{radio-prefix-cls} + * {
279285
border-color: @radio-button-active-color;
280286
}
281287
&:focus-within {
282-
outline: @radio-focused-outline;
288+
box-shadow: @radio-button-focus-shadow;
283289
}
284290
}
285291

0 commit comments

Comments
 (0)