Skip to content

Commit 07ec765

Browse files
crisbetotinayuangao
authored andcommitted
fix(checkbox, radio): not using theme border color (#2744)
* fix(checkbox, radio): not using theme border color Fixes the checkbox and radio button not using the border color from the theme. The cause of the issue was that both components used the shorthand `border`, which ended up overriding the `border-color` from the theme. * chore: fix leaking test
1 parent 1ab1af1 commit 07ec765

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/lib/checkbox/checkbox.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
196196
}
197197

198198
.mat-checkbox-layout {
199-
// `cursor: inherit` ensures that the wrapper element gets the same cursor as the md-checkbox
199+
// `cursor: inherit` ensures that the wrapper element gets the same cursor as the mat-checkbox
200200
// (e.g. pointer by default, regular when disabled), instead of the browser default.
201201
cursor: inherit;
202202
align-items: baseline;
@@ -234,8 +234,12 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
234234
@extend %mat-checkbox-outer-box;
235235

236236
background-color: transparent;
237-
border: $mat-checkbox-border-width solid;
238-
transition: border-color $mat-checkbox-transition-duration $mat-linear-out-slow-in-timing-function;
237+
transition:
238+
border-color $mat-checkbox-transition-duration $mat-linear-out-slow-in-timing-function;
239+
border: {
240+
width: $mat-checkbox-border-width;
241+
style: solid;
242+
}
239243
}
240244

241245
.mat-checkbox-background {

src/lib/radio/radio.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,18 @@ $mat-radio-ripple-size: $mat-radio-size * 0.75;
3232

3333
// The outer circle for the radio, always present.
3434
.mat-radio-outer-circle {
35-
border: solid 2px;
36-
border-radius: 50%;
3735
box-sizing: border-box;
3836
height: $mat-radio-size;
3937
left: 0;
4038
position: absolute;
4139
top: 0;
4240
transition: border-color ease 280ms;
4341
width: $mat-radio-size;
42+
border: {
43+
width: 2px;
44+
style: solid;
45+
radius: 50%;
46+
}
4447
}
4548

4649
// The inner circle for the radio, shown when checked.

0 commit comments

Comments
 (0)