You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using DaisyUI in my project and have a specific requirement where I need to disable the hover color change for buttons while keeping the original button styles intact.
Currently, my button can have various colors applied, for example:
However, on hover, the button color changes according to DaisyUI's default hover styles. I would like to disable this hover color change so that the button maintains its original colors even when hovered over.
Here is the CSS that is currently being applied on hover:
I have tried overriding the hover styles in my custom CSS, but it seems that the default DaisyUI hover styles are still being applied, resulting in the button reverting to default colors (black text and white background). Here is the custom CSS I used:
/* Custom CSS to override DaisyUI hover styles */
.btn:hover {
--tw-border-opacity: 1;
border-color: inherit !important; /* Inherit the parent color */
--tw-bg-opacity: 1;
background-color: inherit !important; /* Inherit the parent color */
color: inherit !important; /* Inherit the parent color */
}
@supports (color: color-mix(in oklab, black, black)) {
.btn:hover {
background-color: inherit !important; /* Inherit the parent color */
border-color: inherit !important; /* Inherit the parent color */
}
}
@supports not (color: oklch(0 0 0)) {
.btn:hover {
background-color: inherit !important; /* Inherit the parent color */
border-color: inherit !important; /* Inherit the parent color */
}
}
Despite these efforts, the button reverts to default colors when hovered over. Could you please provide guidance on how to effectively disable the hover color change for buttons in DaisyUI without losing the original button styles?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello DaisyUI team,
I am using DaisyUI in my project and have a specific requirement where I need to disable the hover color change for buttons while keeping the original button styles intact.
Currently, my button can have various colors applied, for example:
However, on hover, the button color changes according to DaisyUI's default hover styles. I would like to disable this hover color change so that the button maintains its original colors even when hovered over.
Here is the CSS that is currently being applied on hover:
I have tried overriding the hover styles in my custom CSS, but it seems that the default DaisyUI hover styles are still being applied, resulting in the button reverting to default colors (black text and white background). Here is the custom CSS I used:
Despite these efforts, the button reverts to default colors when hovered over. Could you please provide guidance on how to effectively disable the hover color change for buttons in DaisyUI without losing the original button styles?
Thank you for your assistance!
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions