Git Product home page Git Product logo

Comments (9)

benjitrosch avatar benjitrosch commented on June 5, 2024

@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.

exoRift avatar exoRift commented on June 5, 2024

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.

benjitrosch avatar benjitrosch commented on June 5, 2024

@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.

exoRift avatar exoRift commented on June 5, 2024

image
These are the active styles

Overwritten by the hover's !importants
image

from react-daisyui.

benjitrosch avatar benjitrosch commented on June 5, 2024

@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.

exoRift avatar exoRift commented on June 5, 2024

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 !importants.

    .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 !importants 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.

benjitrosch avatar benjitrosch commented on June 5, 2024

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.

exoRift avatar exoRift commented on June 5, 2024

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.

exoRift avatar exoRift commented on June 5, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.