Display: Fix styles for checkboxs and radiobuttons

pull/5688/head
Angel Fernando Quiroz Campos 4 months ago
parent 4599b6ac36
commit c6f0d340ab
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 55
      assets/css/scss/atoms/_checkbox.scss
  2. 97
      assets/css/scss/atoms/_radio.scss

@ -1,34 +1,51 @@
.p-checkbox {
@apply h-4 w-4;
@apply relative inline-flex select-none align-bottom h-4 w-4;
.p-checkbox-box {
@apply border border-solid border-gray-50 bg-white h-4 rounded w-4 transition-none invisible;
&-input {
@apply cursor-pointer;
}
&-box {
@apply flex justify-center items-center;
}
& &-input {
@apply appearance-none absolute top-0 left-0 w-full h-full p-0 m-0 opacity-0 z-[1] outline-none border-2 border-support-3 rounded;
}
& &-box {
@apply border-2 border-support-3 bg-white w-4 h-4 text-primary rounded transition-none outline-none;
.p-checkbox-icon {
@apply text-caption font-semibold text-white;
}
@apply duration-200 text-white text-tiny;
&.p-highlight {
@apply border-gray-90 bg-gray-50;
&.p-icon {
@apply w-2.5 h-2.5;
}
}
}
&:not(.p-checkbox-disabled) {
&.p-highlight &-box {
@apply border-primary bg-primary;
}
&:not(.p-disabled):has(&-input:hover) {
.p-checkbox-box {
&:hover {
@apply border-primary;
}
@apply border-primary;
}
.p-checkbox-box.p-focus {
@apply outline-none outline-offset-0;
&.p-highlight .p-checkbox-box {
@apply border-primary bg-primary text-white;
}
.p-checkbox-box.p-highlight {
@apply bg-support-4 hover:border-primary;
}
&:not(.p-disabled):has(&-input:focus-visible) {
.p-checkbox-box {
@apply outline-none drop-shadow-lg bg-primary;
}
}
}
.p-checkbox.p-invalid {
>.p-checkbox-box {
&.p-invalid > &-box {
@apply border-error;
}
}

@ -1,74 +1,59 @@
$color_1: #3f3f46;
$background-color_2: #fafafa;
$border-color_1: #d4d4d8;
.p-radiobutton {
@apply h-4 w-4;
@apply relative inline-flex select-none align-bottom w-4 h-4;
.p-radiobutton-box {
@apply bg-white border border-solid border-gray-50 rounded-full h-4 w-4;
color: $color_1;
&-input {
@apply cursor-pointer;
}
&:not(.p-disabled) {
&:not(.p-highlight) {
&:hover {
border-color: $border-color_1;
}
}
}
&-box {
@apply flex justify-center items-center;
}
&:not(.p-disabled).p-focus {
@apply outline-none outline-offset-0 border-primary;
}
&-icon {
@apply rounded-full invisible;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
transform: translateZ(0) scale(0.1);
}
.p-radiobutton-icon {
width: 6px;
height: 6px;
@apply bg-white duration-200;
}
&.p-highlight &-icon {
@apply visible;
transform: translateZ(0) scale(1, 1);
}
&.p-highlight {
@apply bg-primary border-primary;
& &-input {
@apply appearance-none absolute top-0 left-0 w-full h-full p-0 m-0 opacity-0 z-[1] outline-none border-2 border-support-3;
}
&:not(.p-disabled) {
&:hover {
@apply bg-primary border-primary text-white;
}
}
}
& &-box {
@apply border-2 border-support-3 bg-white w-4 h-4 text-primary rounded-full transition-none outline-none;
}
&:focus {
@apply outline-none;
& &-box &-icon {
@apply w-1.5 h-1.5 duration-200 bg-white;
}
&.p-invalid {
> .p-radiobutton-box {
@apply border-error;
}
&.p-highlight &-box {
@apply border-primary bg-primary;
}
}
.p-input-filled {
.p-radiobutton {
&:not(.p-disabled):has(&-input:hover) {
.p-radiobutton-box {
background-color: $background-color_2;
&:not(.p-disabled) {
&:hover {
background-color: $background-color_2;
}
}
@apply border-primary;
}
&.p-highlight {
@apply bg-primary;
&.p-highlight .p-radiobutton-box {
@apply border-primary bg-primary text-white;
}
}
&:not(.p-disabled) {
&:hover {
@apply bg-primary;
}
}
}
&:not(.p-disabled):has(&-input:focus-visible) {
.p-radiobutton-box {
@apply outline-none drop-shadow-lg bg-primary;
}
}
}
&.p-invalid > &-box {
@apply border-error;
}
}
Loading…
Cancel
Save