Skip to content

Commit 13a25f3

Browse files
authored
Merge pull request matrix-org#4778 from matrix-org/t3chguy/notifications0
Fix Styled Checkbox and Radio Button disabled state
2 parents f112d17 + 26e763d commit 13a25f3

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

res/css/views/elements/_StyledCheckbox.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@ limitations under the License.
7070
& + label > *:not(.mx_Checkbox_background) {
7171
margin-left: 10px;
7272
}
73+
74+
&:disabled + label {
75+
opacity: 0.5;
76+
cursor: not-allowed;
77+
}
78+
79+
&:checked:disabled + label > .mx_Checkbox_background {
80+
background-color: $muted-fg-color;
81+
border-color: rgba($muted-fg-color, 0.5);
82+
}
7383
}
7484
}

res/css/views/elements/_StyledRadioButton.scss

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ limitations under the License.
2020
*/
2121

2222
.mx_RadioButton {
23-
2423
$radio-circle-color: $muted-fg-color;
2524
$active-radio-circle-color: $accent-color;
2625
position: relative;
@@ -76,22 +75,32 @@ limitations under the License.
7675
border-radius: $font-8px;
7776
}
7877
}
79-
}
8078

81-
> input[type=radio]:checked {
82-
+ div {
83-
border-color: $active-radio-circle-color;
79+
&:checked {
80+
& + div {
81+
border-color: $active-radio-circle-color;
8482

85-
> div {
86-
background: $active-radio-circle-color;
83+
& > div {
84+
background: $active-radio-circle-color;
85+
}
8786
}
8887
}
89-
}
9088

91-
> input[type=radio]:disabled {
92-
+ div {
93-
> div {
94-
display: none;
89+
&:disabled {
90+
& + div,
91+
& + div + span {
92+
opacity: 0.5;
93+
cursor: not-allowed;
94+
}
95+
96+
& + div {
97+
border-color: $radio-circle-color;
98+
}
99+
}
100+
101+
&:checked:disabled {
102+
& + div > div {
103+
background-color: $radio-circle-color;
95104
}
96105
}
97106
}

0 commit comments

Comments
 (0)