In your upgrade guide, in the section for overriding Tailwind V4's new cursor: default default setting, you suggest adding the following:
@layer base {
button:not(:disabled),
[role="button"]:not(:disabled) {
cursor: pointer;
}
}
However, [role="button"]:not(:disabled) is incorrect/inaccurate because non-form elements do not have the concept of disabled (and thus the :disabled pseudo-class will not apply to them). You would only use role=button on an element such as a <div>, so whilst this selector will technically work, it's not accurate because a <div> should never have disabled/:disabled, and you should instead be using aria-disabled
So, technically, the recommended CSS should be:
@layer base {
button:not(:disabled),
[role="button"]:not([aria-disabled=true]) {
cursor: pointer;
}
}
In your upgrade guide, in the section for overriding Tailwind V4's new
cursor: defaultdefault setting, you suggest adding the following:However,
[role="button"]:not(:disabled)is incorrect/inaccurate because non-form elements do not have the concept ofdisabled(and thus the:disabledpseudo-class will not apply to them). You would only userole=buttonon an element such as a<div>, so whilst this selector will technically work, it's not accurate because a<div>should never havedisabled/:disabled, and you should instead be usingaria-disabledSo, technically, the recommended CSS should be: