Comments (9)
@exoRift I'm not seeing this behavior, at the moment the active style takes precedence over hover. Can you post an example (as well as which browser you're using)?
from react-daisyui.
Set up the following (not sure if the classes are relevant, but I'm copying them from my impl):
return (
<Navbar className='bg-base-200 sticky top-0 px-4 bg-opacity-80 backdrop-blur-sm z-40'>
<Navbar.Start>
<Menu horizontal>
<Menu.Item>
<a href='/'>some anchor</a>
</Menu.Item>
</Menu>
</Navbar.Start>
</Navbar>
)
You'll notice that upon clicking on the anchor, there is no change. However, if you use the inspector to force an active state (without hovering over), you'll see that the anchor bg transitions to neutral.
I'm using Chrome on Windows.
from react-daisyui.
@exoRift threw the code you provided into a quick code sandbox with react-daisyui 4.0.2 (in Chrome from my Windows 11 desktop) and everything looks good:
2023-07-31.15-54-09.online-video-cutter.com.mp4
What theme are you using? It's possible the palette you've chosen/setup has low contrast between hover and active so it's not as noticeable? Or maybe the colors are reversed?
from react-daisyui.
Overwritten by the hover's !important
s
from react-daisyui.
@exoRift !important
is neither added in daisyui
nor in react-daisyui
source code.
It's hard for me to say what's going wrong in your application without any context for the rest of your codebase. Maybe take a look in your globals.css
file and see if some pre-existing CSS is overriding the daisyui
styles.
from react-daisyui.
It certainly is odd. I don't have this issue with version 3.1.2 and this specific style seems to be the only one rendered with !important
s.
.dropdown.dropdown-hover:hover .dropdown-content {
--tw-scale-x: 1;
--tw-scale-y: 1;
transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}
:where(.menu li:not(.menu-title):not(.disabled)>:not(ul):not(details):not(.menu-title)):not(.active):hover,:where(.menu li:not(.menu-title):not(.disabled)>details>summary:not(.menu-title)):not(.active):hover {
cursor: pointer;
background-color: hsl(var(--bc)/.1);
--tw-text-opacity: 1;
color: hsl(var(--bc)/var(--tw-text-opacity));
outline: 2px solid transparent;
outline-offset: 2px
}
:where(.menu li:not(.menu-title):not(.\!disabled)>:not(ul):not(details):not(.menu-title)):not(.active):hover,:where(.menu li:not(.menu-title):not(.\!disabled)>details>summary:not(.menu-title)):not(.active):hover {
cursor: pointer!important;
background-color: hsl(var(--bc)/.1)!important;
--tw-text-opacity: 1!important;
color: hsl(var(--bc)/var(--tw-text-opacity))!important;
outline: 2px solid transparent!important;
outline-offset: 2px!important
}
.tab[disabled],.tab[disabled]:hover {
cursor: not-allowed;
color: hsl(var(--bc)/var(--tw-text-opacity));
--tw-text-opacity: 0.2
}
}
From the built CSS file
I don't have any !important
s in my code even remotely related to this.
I have no way to trace it and the only indication I have is globals.css:5
which is just @tailwind components;
I will confirm that this doesn't seem to happen on the react-daisyui Storybook.
from react-daisyui.
Thanks, do let me know if you experience it on the Storybook because that's working as expected for me.
You wouldn't happen to have a browser extension that affects the styles on a page, e.g. recolors them or adds a fake dark mode? That's all I can think of assuming the rest of your project is totally boilerplate.
from react-daisyui.
No, I don't. Just gonna hope this bug manifests elsewhere in some easier-narrowed fashion and gets fixed in some patch.
from react-daisyui.
@benjitrosch I just wanted to let you know that a cause has been identified here and it's most likely a bug with Tailwind
tailwindlabs/tailwindcss#12099
from react-daisyui.
Related Issues (20)
- Button loading prop does not work when startIcon is set HOT 2
- [Help] Modal backdrop props is not working HOT 2
- [4.0.1]: `Join` component not exported by the module HOT 1
- [4.0.1]: New Modal causes reflow issues HOT 3
- [4.0.2]: `Loading` not exported HOT 1
- Add `cursor: default` to the Modal backdrop button HOT 3
- ModalLegacyProps type is not exported HOT 3
- Menu dropdown doesn't close after click? HOT 2
- Type Errors if Select.Option are rendered both statically and dynamically HOT 1
- Can't create form inside Modal HOT 2
- New Modal with useRef hook generates a warning/error in console HOT 1
- Swap.onClick fires twice HOT 5
- add start and end icon to Input component HOT 1
- Tooltip positioning end of screen
- Canonical react-daisyui example HOT 1
- Server-side component for Next.js
- Range component UI issues HOT 3
- Feat: Debounce option for `Input` component HOT 1
- Vite + React + TS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-daisyui.