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(theme): use data-hover instead of hover #2110

Merged
merged 1 commit into from
Sep 10, 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
5 changes: 5 additions & 0 deletions .changeset/eleven-eels-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

fix(theme): use data-hover instead of hover (#2095)
24 changes: 18 additions & 6 deletions packages/core/theme/src/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,44 @@ const button = tv({
{
variant: "ghost",
color: "default",
class: colorVariants.ghost.default,
class: [colorVariants.ghost.default, "data-[hover=true]:!bg-default"],
},
{
variant: "ghost",
color: "primary",
class: colorVariants.ghost.primary,
class: [
colorVariants.ghost.primary,
"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground",
],
},
{
variant: "ghost",
color: "secondary",
class: colorVariants.ghost.secondary,
class: [
colorVariants.ghost.secondary,
"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground",
],
},
{
variant: "ghost",
color: "success",
class: colorVariants.ghost.success,
class: [
colorVariants.ghost.success,
"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground",
],
},
{
variant: "ghost",
color: "warning",
class: colorVariants.ghost.warning,
class: [
colorVariants.ghost.warning,
"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground",
],
},
{
variant: "ghost",
color: "danger",
class: colorVariants.ghost.danger,
class: [colorVariants.ghost.danger, "data-[hover=true]:!bg-danger !text-danger-foreground"],
},
// isInGroup / radius / size <-- radius not provided
{
Expand Down
12 changes: 6 additions & 6 deletions packages/core/theme/src/utils/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ const light = {
};

const ghost = {
default: "border-default text-default-foreground hover:!bg-default",
primary: "border-primary text-primary hover:!text-primary-foreground hover:!bg-primary",
secondary: "border-secondary text-secondary hover:text-secondary-foreground hover:!bg-secondary",
success: "border-success text-success hover:!text-success-foreground hover:!bg-success",
warning: "border-warning text-warning hover:!text-warning-foreground hover:!bg-warning",
danger: "border-danger text-danger hover:!text-danger-foreground hover:!bg-danger",
default: "border-default text-default-foreground",
primary: "border-primary text-primary",
secondary: "border-secondary text-secondary",
success: "border-success text-success",
warning: "border-warning text-warning",
danger: "border-danger text-danger",
foreground: "border-foreground text-foreground hover:!bg-foreground",
};

Expand Down