Skip to content

Explicitly set visited state of unstyled button#3846

Merged
thisisdano merged 1 commit into
uswds:developfrom
andycochran:develop
Dec 8, 2020
Merged

Explicitly set visited state of unstyled button#3846
thisisdano merged 1 commit into
uswds:developfrom
andycochran:develop

Conversation

@andycochran
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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.

2 participants