Skip to content

Commit cc25720

Browse files
authored
fix(1.x/radio): replace 'outline' with 'box-shadow' (#3954)
* fix(radio): replace 'outline' with 'box-shadow' Closes #3671 * style: remove comment
1 parent 5cec702 commit cc25720

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Diff for: components/radio/style/index.less

+18-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
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-focus-shadow: 0 0 0 3px fade(@radio-dot-color, 8%);
9+
@radio-button-focus-shadow: @radio-focus-shadow;
910

1011
.@{radio-group-prefix-cls} {
1112
.reset-component;
@@ -42,7 +43,7 @@
4243
}
4344

4445
&-input:focus + .@{radio-inner-prefix-cls} {
45-
box-shadow: 0 0 0 3px fade(@radio-dot-color, 8%);
46+
box-shadow: @radio-focus-shadow;
4647
}
4748

4849
&-checked::after {
@@ -162,7 +163,7 @@ span.@{radio-prefix-cls} + * {
162163
border-top-width: @border-width-base + 0.02px;
163164
border-left: 0;
164165
cursor: pointer;
165-
transition: color 0.3s, background 0.3s, border-color 0.3s;
166+
transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
166167

167168
a {
168169
color: @radio-button-color;
@@ -190,12 +191,15 @@ span.@{radio-prefix-cls} + * {
190191
&:not(:first-child) {
191192
&::before {
192193
position: absolute;
193-
top: 0;
194+
top: @border-width-base * -1;
194195
left: -1px;
195196
display: block;
197+
box-sizing: content-box;
196198
width: 1px;
197199
height: 100%;
200+
padding: @border-width-base 0;
198201
background-color: @border-color-base;
202+
transition: background-color 0.3s;
199203
content: '';
200204
}
201205
}
@@ -218,7 +222,7 @@ span.@{radio-prefix-cls} + * {
218222
}
219223

220224
&:focus-within {
221-
outline: @radio-focused-outline;
225+
box-shadow: @radio-button-focus-shadow;
222226
}
223227

224228
.@{radio-prefix-cls}-inner,
@@ -235,32 +239,33 @@ span.@{radio-prefix-cls} + * {
235239
color: @radio-dot-color;
236240
background: @radio-button-checked-bg;
237241
border-color: @radio-dot-color;
238-
box-shadow: -1px 0 0 0 @radio-dot-color;
239242

240243
&::before {
241-
background-color: @radio-dot-color !important;
242-
opacity: 0.1;
244+
background-color: @radio-dot-color;
243245
}
244246

245247
&:first-child {
246248
border-color: @radio-dot-color;
247-
box-shadow: none !important;
248249
}
249250

250251
&:hover {
251252
color: @radio-button-hover-color;
252253
border-color: @radio-button-hover-color;
253-
box-shadow: -1px 0 0 0 @radio-button-hover-color;
254+
&::before {
255+
background-color: @radio-button-hover-color;
256+
}
254257
}
255258

256259
&:active {
257260
color: @radio-button-active-color;
258261
border-color: @radio-button-active-color;
259-
box-shadow: -1px 0 0 0 @radio-button-active-color;
262+
&::before {
263+
background-color: @radio-button-active-color;
264+
}
260265
}
261266

262267
&:focus-within {
263-
outline: @radio-focused-outline;
268+
box-shadow: @radio-button-focus-shadow;
264269
}
265270
}
266271

@@ -279,7 +284,7 @@ span.@{radio-prefix-cls} + * {
279284
border-color: @radio-button-active-color;
280285
}
281286
&:focus-within {
282-
outline: @radio-focused-outline;
287+
box-shadow: @radio-button-focus-shadow;
283288
}
284289
}
285290

0 commit comments

Comments
 (0)