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

bug: .btn transform and "stretched link" #2961

Closed
pawelpbm opened this issue Apr 4, 2024 · 3 comments
Closed

bug: .btn transform and "stretched link" #2961

pawelpbm opened this issue Apr 4, 2024 · 3 comments

Comments

@pawelpbm
Copy link

pawelpbm commented Apr 4, 2024

What version of daisyUI are you using?

4.7.2

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://play.tailwindcss.com/nkymmKsw2I

Describe your issue

In few places in my project I'm using "stretched link" - which is something I originally found in Bootstrap. I'm currently porting the project to Tailwind + Daisy and for that element I'm using suggestion provided in Tailwind's Github.

It was working fine on most of the elements where the link was just a text element but now I'm trying to get it working with .btn - and this is failing...

What happens: when hovering over the card, cursor changes to link coursor and browser shows the link in the bottom left, but when clicking it, nothing happens.

Minimal repro is here: https://play.tailwindcss.com/nkymmKsw2I

After quite a bit of messing with it I narrowed it down to .btn and specifically this part:

.btn:active:hover,
  .btn:active:focus {
  animation: button-pop 0s ease-out;
  transform: scale(var(--btn-focus-scale, 0.97));
}

When I add active:hover:transform-none active:focus:transform-none to the a element all is working fine.

I'm afraid I do not know HTML/CSS good enough to figure out if this is a bug or if I'm doing stuff wrong...

Copy link

github-actions bot commented Apr 4, 2024

Thank you @pawelpbm for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi
Copy link
Owner

saadeghi commented Apr 4, 2024

You can fix this by adding focus:active:transform-none to the button.
https://play.tailwindcss.com/Naw2L95DoR

But this whole thing is unnecessary. It's much simpler to use a <a> tag for the card instead:
https://play.tailwindcss.com/p29aXyhLzJ

Let me know if you have a question.

@saadeghi saadeghi closed this as completed Apr 4, 2024
@pawelpbm
Copy link
Author

pawelpbm commented Apr 4, 2024

I have not thought about using a as the main card elements. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants