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

Preflight base styles is setting cursor:pointer by default on disabled buttons #5768

Closed
antoinebrault opened this issue Oct 12, 2021 · 2 comments · Fixed by #5772
Closed

Comments

@antoinebrault
Copy link

What version of Tailwind CSS are you using?
2.2.15

What build tool (or framework if it abstracts the build tool) are you using?
N/A

What version of Node.js are you using?
N/A

What browser are you using?
Chrome

What operating system are you using?
Windows

Reproduction URL
https://play.tailwindcss.com/SwdqLwDwtm

Describe your issue
disabled buttons have cursor:pointer by default.

base styles are setting cursor:pointer on button, [role="button"], but it shouldn't apply to disabled buttons. Chrome, Firefox & Edge all keep the default cursor on a disabled button.
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_disabled

// not sure if it should be
button:not(:disabled), 
[role="button"]:not(:disabled) {
  cursor: pointer;
}

// or
button, 
[role="button"] {
  cursor: pointer;
}
button:disabled, 
[role="button"]:disabled {
  cursor: default;
}
@adamwathan
Copy link
Member

adamwathan commented Oct 13, 2021

Hey! I think this would be an improvement thanks for suggesting, implemented a solution here:

#5772

Can't do this because the specificity of the selector is too high and you wouldn't be able to change the cursor with a utility:

button:disabled, 
[role="button"]:disabled {
  cursor: default;
}

@antoinebrault
Copy link
Author

Thanks appreciate the quick resolution!

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 a pull request may close this issue.

2 participants