You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Add more checkbox styles (#7058)
Add a "kind" param for StyledCheckbox, allowing designers to choose different styles of checkbox as needed. In addition to the preexisting default kind (now called Solid), there's an Outline kind with a green checkmark and a transparent fill. This is used in the device trust view, since the default checkbox style looks too much like the green "verified" shield and it's awkward to have those next to each other.
This commit is contained in:
@@ -48,22 +48,20 @@ limitations under the License.
|
||||
box-sizing: border-box;
|
||||
border-radius: $border-radius;
|
||||
|
||||
img {
|
||||
.mx_Checkbox_checkmark {
|
||||
display: none;
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
filter: invert(100%);
|
||||
mask-image: url('$(res)/img/feather-customised/check.svg');
|
||||
mask-position: center;
|
||||
mask-size: 100%;
|
||||
mask-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
&:checked + label > .mx_Checkbox_background {
|
||||
background: $accent-color;
|
||||
border-color: $accent-color;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
}
|
||||
&:checked + label > .mx_Checkbox_background .mx_Checkbox_checkmark {
|
||||
display: block;
|
||||
}
|
||||
|
||||
& + label > *:not(.mx_Checkbox_background) {
|
||||
@@ -75,11 +73,6 @@ limitations under the License.
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&:checked:disabled + label > .mx_Checkbox_background {
|
||||
background-color: $accent-color;
|
||||
border-color: $accent-color;
|
||||
}
|
||||
|
||||
&.focus-visible {
|
||||
& + label .mx_Checkbox_background {
|
||||
@mixin unreal-focus;
|
||||
@@ -87,3 +80,25 @@ limitations under the License.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mx_Checkbox.mx_Checkbox_kind_solid input[type=checkbox] {
|
||||
& + label > .mx_Checkbox_background .mx_Checkbox_checkmark {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
&:checked + label > .mx_Checkbox_background {
|
||||
background: $accent-color;
|
||||
border-color: $accent-color;
|
||||
}
|
||||
}
|
||||
|
||||
.mx_Checkbox.mx_Checkbox_kind_outline input[type=checkbox] {
|
||||
& + label > .mx_Checkbox_background .mx_Checkbox_checkmark {
|
||||
background: $accent-color;
|
||||
}
|
||||
|
||||
&:checked + label > .mx_Checkbox_background {
|
||||
background: transparent;
|
||||
border-color: $accent-color;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user