Skip to content

Don't use cursor: pointer for buttons by default #8962

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

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

adamwathan
Copy link
Member

This is a pretty common expectation but as outlined in in #8961 isn't really right. We considered this a long time ago but it felt too against the grain at the time. These days though very UI-forward applications like Linear are using the default cursor for buttons and I think this trend will continue as more people become aware that cursor: pointer is meant for links.

Let's update our defaults here to help nudge people in this direction and make it more common. If people want to change this in their own apps, it's just a line or two of CSS to add to their projects.

Closed #8961.

This is a pretty common expectation but as outlined in in #8961 isn't really right. We considered this a long time ago but it felt too against the grain at the time. These days though very UI-forward applications like [Linear](https://linear.app/) are using the default cursor for buttons and I think this trend will continue as more people become aware that `cursor: pointer` is meant for links.

Let's update our defaults here to help nudge people in this direction and make it more common. If people want to change this in their own apps, it's just a line or two of CSS to add to their projects.
@adamwathan adamwathan merged commit ed3a4f3 into master Jul 27, 2022
@adamwathan adamwathan deleted the default-button-cursors branch July 27, 2022 00:55
thecrypticace added a commit that referenced this pull request Jul 29, 2022
thecrypticace added a commit that referenced this pull request Jul 29, 2022
@aleph1ow
Copy link

aleph1ow commented Aug 3, 2022

@thecrypticace why the commit of this pr has been reverted?
Upgrading to 3.1.7 right now and I'm not getting what announced in the changelog

@thecrypticace
Copy link
Contributor

thecrypticace commented Aug 3, 2022

Ah because we wanted to remove it to push out 3.1.7 and when I reverted the commit I forgot to update the Changelog to put it in the "unreleased" section. Sorry about that.

@aleph1ow
Copy link

aleph1ow commented Aug 3, 2022

Ok thanks for clarifying 🙏

thecrypticace added a commit that referenced this pull request Aug 5, 2022
We’re undecided on whether or not this should be released right now so we’ll revert it and revisit it later.
@DaniGuardiola
Copy link

Any estimation of when this will be released?

@danny-does-stuff
Copy link

I would love to see this. As a Tailwind user, I expect Tailwind to use the absolute best practices by default, so leaving cursor: pointer on button makes it seem like this is correct when it is not 😱. Thanks for the great package!

adamwathan pushed a commit that referenced this pull request Jul 29, 2024
Related to #8961 and
#8962

Before v4, buttons got this CSS in preflight:


https://github.com/tailwindlabs/tailwindcss/blob/9824cb64a03afaa405e184cb31003c8a1efafaa7/src/css/preflight.css#L339-L353

v4 (`next` branch) no longer has `cursor: pointer` in
[preflight.css](https://github.com/tailwindlabs/tailwindcss/blob/2fe249963583e436961adc59cf9988af454e3da5/packages/tailwindcss/preflight.css)

This PR removes additional CSS for `:disabled` buttons. It was meant to
undo an override that is no longer present.
@bernaferrari
Copy link

bernaferrari commented Apr 23, 2025

Linear no longer uses default for buttons, now they are using pointer again.

Shadcn/ui v4 has a lot of 'likes' into the bring back cursor issue (this tweet alone has 600 likes https://x.com/shadcn/status/1915038859529949498).

I think this was a big mistake. People with less attention will ship worse and less accessible web apps.

tongrow pushed a commit to tongrow/tailwind-normalize that referenced this pull request Jun 2, 2025
Related to tailwindlabs#8961 and
tailwindlabs#8962

Before v4, buttons got this CSS in preflight:

https://github.com/tailwindlabs/tailwindcss/blob/9824cb64a03afaa405e184cb31003c8a1efafaa7/src/css/preflight.css#L339-L353

v4 (`next` branch) no longer has `cursor: pointer` in
[preflight.css](https://github.com/tailwindlabs/tailwindcss/blob/2fe249963583e436961adc59cf9988af454e3da5/packages/tailwindcss/preflight.css)

This PR removes additional CSS for `:disabled` buttons. It was meant to
undo an override that is no longer present.
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

Successfully merging this pull request may close these issues.

Buttons have cursor: pointer by default, but should not for accessibility reasons
6 participants