Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkbox+radio disabled styles #4509

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/orbit-components/src/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const Checkbox = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
"flex flex-row",
"relative w-full",
"[&_.orbit-checkbox-icon-container]:hover:shadow-none",
"[&_.orbit-checkbox-icon-container]:has-[:checked]:bg-blue-normal [&_.orbit-checkbox-icon-container]:has-[:checked]:hover:bg-blue-dark",
"[&_.orbit-checkbox-icon-container]:has-[:focus]:outline-blue-normal [&_.orbit-checkbox-icon-container]:has-[:focus]:outline [&_.orbit-checkbox-icon-container]:has-[:focus]:outline-2",
"[&_.orbit-checkbox-icon-container>svg]:has-[:checked]:visible",
disabled
Expand All @@ -46,7 +45,7 @@ const Checkbox = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
]
: [
"cursor-pointer",
"[&_.orbit-checkbox-icon-container]:has-[:checked]:border-blue-normal [&_.orbit-checkbox-icon-container]:has-[:checked]:hover:border-blue-dark",
"[&_.orbit-checkbox-icon-container]:has-[:checked]:border-blue-normal [&_.orbit-checkbox-icon-container]:has-[:checked]:bg-blue-normal [&_.orbit-checkbox-icon-container]:has-[:checked]:hover:border-blue-dark [&_.orbit-checkbox-icon-container]:has-[:checked]:hover:bg-blue-dark",
checked &&
!hasError &&
"[&_.orbit-checkbox-icon-container]:bg-blue-normal [&_.orbit-checkbox-icon-container]:border-blue-normal [&_.orbit-checkbox-icon-container]:hover:bg-blue-dark [&_.orbit-checkbox-icon-container]:hover:border-blue-dark",
Expand Down Expand Up @@ -87,9 +86,8 @@ const Checkbox = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
"duration-fast transition-all ease-in-out",
"[&>svg]:size-icon-small",
"[&>svg]:flex [&>svg]:items-center [&>svg]:justify-center",
"active:scale-95",
checked ? "[&>svg]:visible" : "[&>svg]:invisible",
disabled && ["border-cloud-dark"],
disabled ? ["border-cloud-dark"] : "active:scale-95",
)}
>
<Check customColor="white" />
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Radio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
"duration-fast scale-100 transition-all ease-in-out",
"border-solid",
checked ? "border-2" : "border",
"active:scale-95",
!disabled && "active:scale-95",
)}
>
<span
Expand Down
Loading