From 01817388c29acd598fed19d75933e907dde08ef7 Mon Sep 17 00:00:00 2001 From: p-sw Date: Wed, 29 May 2024 22:59:41 +0900 Subject: [PATCH] fix: remove unnecessary layer in checkbox --- packages/react/components/Checkbox.tsx | 32 ++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/react/components/Checkbox.tsx b/packages/react/components/Checkbox.tsx index 0bd0bd8..d8c5430 100644 --- a/packages/react/components/Checkbox.tsx +++ b/packages/react/components/Checkbox.tsx @@ -6,13 +6,13 @@ const checkboxColors = { default: "bg-neutral-200 dark:bg-neutral-700", checked: "bg-neutral-300 dark:bg-neutral-400", disabled: - "peer-disabled/checkbox:bg-neutral-100 dark:peer-disabled/checkbox:bg-neutral-800", + 'has-[input[type="checkbox"]:disabled]:bg-neutral-100 dark:has-[input[type="checkbox"]:disabled]:bg-neutral-800', }, checkmark: "text-black dark:text-white", }; const [checkboxVariant, resolveCheckboxVariantProps] = vcn({ - base: `inline-block rounded-md p-1 size-6 ${checkboxColors.checkmark} ${checkboxColors.background.disabled} peer-disabled/checkbox:cursor-not-allowed transition-colors duration-75 ease-in-out`, + base: `inline-block rounded-md p-1 size-6 ${checkboxColors.checkmark} ${checkboxColors.background.disabled} has-[input[type="checkbox"]:disabled]:cursor-not-allowed transition-colors duration-75 ease-in-out`, variants: { checked: { true: `${checkboxColors.background.checked}`, @@ -47,7 +47,7 @@ const Checkbox = React.forwardRef( return ( <> -