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

Explicitly set visited state of unstyled button #3846

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

andycochran
Copy link
Contributor

@andycochran andycochran commented Nov 23, 2020

Description

This PR explicitly sets the :visited state of unstyled buttons when they are also inverse and outline.

Note: This solves a problem that's specific to <a class="usa-button"> elements that include an href value (i.e. buttons that have a visited state).

When buttons have all three of these classes… 

.usa-button--outline.usa-button--inverse.usa-button--unstyled

their ruleset includes the button-unstyled mixin, which in turn includes the typeset-link mixin, which makes the button look like an anchor by setting all 4 anchor pseudo classes (including a purple :visited state). So, when these 3 classes are used on a dark background, the :visited state is not inversed and the color is not accessible.

This proposed change overrides the mixin's :visited state with the inverse color so that an outline, inverse, unstyled button has the inverse text color and is accessible on a dark background.

* override :visited state from typeset-link mixin included in unstyled/inverse/outline buttons
Copy link
Member

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

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

Excellent — thank you!

@thisisdano thisisdano merged commit ab0864e into uswds:develop Dec 8, 2020
@thisisdano thisisdano mentioned this pull request Dec 17, 2020
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.

None yet

2 participants