Skip to content

Add button examples for hover and focus states of variants#6309

Open
owenatgov wants to merge 1 commit intomainfrom
button-examples
Open

Add button examples for hover and focus states of variants#6309
owenatgov wants to merge 1 commit intomainfrom
button-examples

Conversation

@owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Oct 6, 2025

Adds examples to button for:

  • forced hover state of all variants
  • disabled state of all variants
  • forced focus state, only of the default button since it's the same for all variants

Part of #6257 although will not resolve it

We previously removed a lot of these examples in #6091 however the design system designers expressed that it'd be useful to see these examples at a glance, in particular the different colours.

This could be remedied more completely by some sort of states API as detailed in #6257 (comment), but this PR does the job for now

@owenatgov owenatgov requested a review from a team October 6, 2025 08:47
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

📋 Stats

No changes to any distributed file sizes!


Action run for e8f5f6a

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-6309 October 7, 2025 11:19 Inactive
Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good for the added states, should the :active state be on there as well?

Wondering also if we should have the focus styles on there as well to see if there's any styles for the variant leaking in the focus style when they shouldn't.

Same could be said for having combinations (:hover + :active, :focus + :hover, :focus + :hover + :active) but that starts to be a lot 😓

@owenatgov
Copy link
Contributor Author

@romaricpascal I'm finally coming back to this. I've updated the PR to include:

  • active states per variant
  • hover states per variant as opposed to just the one

I tried doing at least one combination to get the yellow outline when you have focus combined with another state but I couldn't get it to work. I wonder if there might be something wrong with our review app pseudo classes, but I'd like to propose this be out of scope of this PR.

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.

3 participants