Skip to content

Commit acedadc

Browse files
crisbetovictoriaaa234
authored andcommitted
fix(radio): circle not being greyed out when disabled (#12127)
Fixes the radio button circle not being greyed out when it is disabled. It seems like we had the styles in place already, however they were with a lower specificity than the other theme styles. Fixes #12125.
1 parent f96fcc9 commit acedadc

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/lib/radio/_radio-theme.scss

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@
2727
border-color: mat-color($foreground, secondary-text);
2828
}
2929

30-
.mat-radio-disabled .mat-radio-outer-circle {
31-
border-color: mat-color($foreground, disabled);
32-
}
33-
34-
.mat-radio-disabled {
35-
.mat-radio-ripple .mat-ripple-element, .mat-radio-inner-circle {
36-
background-color: mat-color($foreground, disabled);
37-
}
38-
39-
.mat-radio-label-content {
40-
color: mat-color($foreground, disabled);
41-
}
42-
}
43-
4430
.mat-radio-button {
4531
&.mat-primary {
4632
@include _mat-radio-color($primary);
@@ -53,6 +39,25 @@
5339
&.mat-warn {
5440
@include _mat-radio-color($warn);
5541
}
42+
43+
// This needs extra specificity, because the classes above are combined
44+
// (e.g. `.mat-radio-button.mat-accent`) which increases their specificity a lot.
45+
// TODO: consider making the selectors into descendants (`.mat-primary .mat-radio-button`).
46+
&.mat-radio-disabled {
47+
&.mat-radio-checked .mat-radio-outer-circle,
48+
.mat-radio-outer-circle {
49+
border-color: mat-color($foreground, disabled);
50+
}
51+
52+
.mat-radio-ripple .mat-ripple-element,
53+
.mat-radio-inner-circle {
54+
background-color: mat-color($foreground, disabled);
55+
}
56+
57+
.mat-radio-label-content {
58+
color: mat-color($foreground, disabled);
59+
}
60+
}
5661
}
5762
}
5863

0 commit comments

Comments
 (0)