-
Notifications
You must be signed in to change notification settings - Fork 107
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
Correctly style disabled warning button #1051
Conversation
Your simpler approach makes sense to me, but given that GOV do the same, it'd be worth understanding why. Did you ask on xgov slack? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks a lot simpler to me! 🙌
I wonder if the .nhsuk-button--disabled
class ought to be removed? I can’t see any valid use case for styling a button as disabled if it isn’t actually disabled, and if it is disabled, then the .nhsuk-button:disabled
selector will style it anyway?
@paulrobertlloyd you’ll have to update/rebase from main to get the newly-split-up tests to run. |
444d502
to
cfe777f
Compare
Rebased with Happy to remove
This is not addressable using the Not sure if ‘disabled links’ is a markup pattern that should really be supported; GOV.UK Frontend only allows you to disable |
@anandamaryon1 I asked on X-GOV Slack and this is likely a holdover from a previous design for disabled buttons which all used the same colour; I’m going to add a PR to simplify the disabled styles over there, too. |
cfe777f
to
a086cbe
Compare
Hmm… links styled as disabled buttons… 😵💫 |
More investigation… it’s complicated. We disable |
I'm happy with this, thanks @paulrobertlloyd Links styled as disabled buttons doesn't seem good, I can't think of a legitimate use-case for them. Plus making actually disabled links is a whole messy thing: https://css-tricks.com/how-to-disable-links/ Is it gung-ho to just remove it? |
I can well imagine some services using this anti-pattern; if we were to remove it in a minor release, links that should appear/behave disabled would potentially start ‘working’. Let’s merge this fix in for the next minor release. I can create a PR to remove support for disabled links for the next major release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
Description
Fixes #1034.
I’m not really sure why so much CSS is being used to style disabled buttons! We appear to give disabled buttons background colours that have already been defined, and so much else, when all we need to do is give buttons with
nhsuk-button--disabled
class ordisabled
0.5
opacity, change to the default cursor and remove pointer-events.Maybe I’m missing something? (I note that GDS do the same for
govuk-frontend
so might be something to ask them about this on X-GOV Slack)?Checklist