Skip to content

Commit

Permalink
fix: #970
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Jul 23, 2022
1 parent 6d2ea11 commit 4af523d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
15 changes: 10 additions & 5 deletions src/components/styled/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
outline-offset: 2px;
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
@apply bg-base-content bg-no-repeat;
animation: checkmark var(--animation-input, 0.2s) ease-in-out;
background-image: linear-gradient(-45deg, transparent 65%, hsl(var(--chkbg)) 65.99%), linear-gradient(45deg, transparent 75%, hsl(var(--chkbg)) 75.99%), linear-gradient(-45deg, hsl(var(--chkbg)) 40%, transparent 40.99%), linear-gradient(45deg, hsl(var(--chkbg)) 30%, hsl(var(--chkfg)) 30.99%, hsl(var(--chkfg)) 40%, transparent 40.99%), linear-gradient(-45deg, hsl(var(--chkfg)) 50%, hsl(var(--chkbg)) 50.99%);
Expand All @@ -25,7 +26,8 @@
outline: 2px solid hsl(var(--p));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
@apply border-primary bg-primary text-primary-content;
}
}
Expand All @@ -37,7 +39,8 @@
outline: 2px solid hsl(var(--s));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
@apply border-secondary bg-secondary text-secondary-content;
}
}
Expand All @@ -49,7 +52,8 @@
outline: 2px solid hsl(var(--a));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
@apply border-accent bg-accent text-accent-content;
}
}
Expand Down Expand Up @@ -80,7 +84,8 @@ body[dir="rtl"] {
--chkbg: var(--bc);
--chkfg: var(--b1);
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
background-image: linear-gradient(45deg, transparent 65%, hsl(var(--chkbg)) 65.99%), linear-gradient(-45deg, transparent 75%, hsl(var(--chkbg)) 75.99%), linear-gradient(45deg, hsl(var(--chkbg)) 40%, transparent 40.99%), linear-gradient(-45deg, hsl(var(--chkbg)) 30%, hsl(var(--chkfg)) 30.99%, hsl(var(--chkfg)) 40%, transparent 40.99%), linear-gradient(45deg, hsl(var(--chkfg)) 50%, hsl(var(--chkbg)) 50.99%);
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/components/styled/radio.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
outline: 2px solid hsl(var(--bc));
outline-offset: 2px;
}
&:checked {
&:checked,
&[aria-checked=true] {
@apply bg-base-content;
animation: radiomark var(--animation-input, 0.2s) ease-in-out;
box-shadow: 0 0 0 4px hsl(var(--b1)) inset, 0 0 0 4px hsl(var(--b1)) inset;
Expand All @@ -17,7 +18,8 @@
&:focus-visible {
outline: 2px solid hsl(var(--p));
}
&:checked {
&:checked,
&[aria-checked=true] {
@apply border-primary bg-primary text-primary-content;
}
}
Expand All @@ -27,7 +29,8 @@
&:focus-visible {
outline: 2px solid hsl(var(--s));
}
&:checked {
&:checked,
&[aria-checked=true] {
@apply border-secondary bg-secondary text-secondary-content;
}
}
Expand All @@ -37,7 +40,8 @@
&:focus-visible {
outline: 2px solid hsl(var(--a));
}
&:checked {
&:checked,
&[aria-checked=true] {
@apply border-accent bg-accent text-accent-content;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/styled/rating.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
& .rating-hidden {
@apply w-2 bg-transparent;
}
input:checked ~ input {
input:checked ~ input,
input[aria-checked=true] ~ input {
@apply bg-opacity-20;
}
input:focus-visible {
Expand Down
12 changes: 8 additions & 4 deletions src/components/styled/toggle.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
outline-offset: 2px;
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
--chkbg: hsl(var(--bc));
@apply border-opacity-100 bg-opacity-100;
box-shadow: var(--handleoffset) 0 0 2px hsl(var(--b1)) inset, 0 0 0 2px hsl(var(--b1)) inset;
Expand All @@ -30,7 +31,8 @@
outline: 2px solid hsl(var(--p));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
--chkbg: hsl(var(--p));
@apply border-primary;
@apply border-primary border-opacity-10 bg-primary text-primary-content;
Expand All @@ -41,7 +43,8 @@
outline: 2px solid hsl(var(--s));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
--chkbg: hsl(var(--s));
@apply border-secondary;
@apply border-secondary border-opacity-10 bg-secondary text-secondary-content;
Expand All @@ -52,7 +55,8 @@
outline: 2px solid hsl(var(--a));
}
&:checked,
&[checked="true"] {
&[checked="true"],
&[aria-checked=true] {
--chkbg: hsl(var(--a));
@apply border-accent;
@apply border-accent border-opacity-10 bg-accent text-accent-content;
Expand Down

0 comments on commit 4af523d

Please sign in to comment.