signal-desktop/stylesheets/components/CircleCheckbox.scss

176 lines
3.8 KiB
SCSS
Raw Normal View History

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2024-11-15 23:09:31 +00:00
@use '../mixins';
@use '../variables';
.CircleCheckbox {
&__checkbox {
position: relative;
height: 20px;
width: 20px;
2023-02-23 21:32:19 +00:00
input {
cursor: pointer;
height: 0;
position: absolute;
width: 0;
2024-11-15 23:09:31 +00:00
@include mixins.keyboard-mode {
&:focus {
&::before {
2024-11-15 23:09:31 +00:00
border-color: variables.$color-ultramarine;
}
outline: none;
}
}
&::before {
2024-11-15 23:09:31 +00:00
@include mixins.rounded-corners;
background: inherit;
content: '';
display: block;
height: 20px;
position: absolute;
width: 20px;
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
border: 1.5px solid variables.$color-gray-25;
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
border: 1.5px solid variables.$color-gray-65;
}
}
&:disabled {
cursor: inherit;
}
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
&:disabled {
&::before {
2024-11-15 23:09:31 +00:00
border-color: variables.$color-gray-15;
}
}
&:disabled:checked {
&::before {
2024-11-15 23:09:31 +00:00
background: variables.$color-gray-15;
border-color: variables.$color-gray-15;
}
}
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
&:disabled {
&::before {
2024-11-15 23:09:31 +00:00
border-color: variables.$color-gray-45;
}
}
&:disabled:checked {
&::before {
2024-11-15 23:09:31 +00:00
background: variables.$color-gray-45;
border-color: variables.$color-gray-45;
}
}
}
2023-02-23 21:32:19 +00:00
&:checked {
&::after {
content: '';
display: block;
position: absolute;
}
}
}
input[type='checkbox'] {
&:checked {
&:not([disabled])::before {
2024-11-15 23:09:31 +00:00
background: variables.$color-ultramarine;
border: 1.5px solid variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
}
&::after {
2024-11-15 23:09:31 +00:00
@include mixins.color-svg(
2023-05-04 18:04:22 +00:00
'../images/icons/v3/check/check-compact-bold.svg',
2024-11-15 23:09:31 +00:00
variables.$color-white
2023-05-04 18:04:22 +00:00
);
2024-11-15 23:09:31 +00:00
& {
width: 14px;
height: 14px;
top: 3px;
inset-inline-start: 3px;
}
2023-02-23 21:32:19 +00:00
}
}
}
input[type='radio'] {
&:checked {
&::before {
2024-11-15 23:09:31 +00:00
border: 2px solid variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
}
&::after {
2024-11-15 23:09:31 +00:00
background: variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
top: 4px;
2023-04-20 17:03:43 +00:00
inset-inline-start: 4px;
2023-02-23 21:32:19 +00:00
width: 12px;
height: 12px;
border-radius: 6px;
}
}
}
&--small {
height: 18px;
width: 18px;
input {
&::before {
height: 18px;
width: 18px;
}
}
input[type='checkbox'] {
&:checked {
&::before {
2024-11-15 23:09:31 +00:00
background: variables.$color-ultramarine;
border: 1.5px solid variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
}
&::after {
2024-11-15 23:09:31 +00:00
border: solid variables.$color-white;
2023-02-23 21:32:19 +00:00
border-width: 0 2px 2px 0;
height: 10px;
2023-04-20 17:03:43 +00:00
/* stylelint-disable-next-line liberty/use-logical-spec */
2023-02-23 21:32:19 +00:00
left: 7px;
top: 3px;
transform: rotate(45deg);
width: 5px;
}
}
}
input[type='radio'] {
&:checked {
&::before {
2024-11-15 23:09:31 +00:00
border: 2px solid variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
}
&::after {
2024-11-15 23:09:31 +00:00
background: variables.$color-ultramarine;
2023-02-23 21:32:19 +00:00
top: 4px;
2023-04-20 17:03:43 +00:00
/* stylelint-disable-next-line liberty/use-logical-spec */
2023-02-23 21:32:19 +00:00
left: 4px;
width: 10px;
height: 10px;
border-radius: 5px;
}
}
}
}
}
}