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

USWDS - Bug: Links styled as buttons break in forms #5066

Closed
2 tasks done
scottkellum opened this issue Dec 10, 2022 · 1 comment · Fixed by #5112
Closed
2 tasks done

USWDS - Bug: Links styled as buttons break in forms #5066

scottkellum opened this issue Dec 10, 2022 · 1 comment · Fixed by #5112
Assignees
Labels
Status: Triage We're triaging this issue and grooming if necessary Type: Bug A problem in the code

Comments

@scottkellum
Copy link

Describe the bug

This commit seems to break button styling in forms: 8b57c7b

Button and link styling seem to be working fine without this line. I’m not sure what bug it was meant to solve in the first place but maybe it doesn’t need to be there anymore? If it does need to be there, increasing the specificity of buttons will work by doubling the class on _usa-button.scss to .usa-button.usa-button. This is, of coarse, not very elegant. This is a specificity bug though.

Steps to reproduce the bug

Use the following code on a USWDS page:

<form class="usa-form">
	<a class="usa-button" href="#">This button text will be invisible</a>
	<input class="usa-button" type="submit" value="This text is visible" />
</form>

Expected Behavior

The text in the button should be visible

Related code

<form class="usa-form">
	<a class="usa-button" href="#test">This button text will be invisible</a>
	<input class="usa-button" type="submit" value="This text is visible" />
</form>

Screenshots

Screenshot 2022-12-09 at 4 16 06 PM

System setup

  • USWDS 3.3.0
  • Mac Mini M1
  • Mac OS 13.0.1
  • Chromium based browser (Arc 0.80.0)

Additional context

No response

Code of Conduct

@scottkellum scottkellum added Needs: Confirmation We need to confirm that this is an issue Status: Triage We're triaging this issue and grooming if necessary Type: Bug A problem in the code labels Dec 10, 2022
@mahoneycm
Copy link
Contributor

I am able to replicate the bug. The typeset-link mixin is important because it overrides clicked links as well. For example, in this screenshot the Forgot password? link turns purple without typeset-link

Image

@mejiaj It looks like we could try out the :not() selector to target anchor tags with the usa-button class. We've used it before and it has pretty good usability on CanIUse

  a:not(.usa-button) {
    @include typeset-link;
  }

Result:

Image

@mahoneycm mahoneycm removed the Needs: Confirmation We need to confirm that this is an issue label Jan 19, 2023
thisisdano added a commit that referenced this issue Mar 8, 2023
USWDS - Links: Fix invisible text when styled as buttons within forms. Resolves #5066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage We're triaging this issue and grooming if necessary Type: Bug A problem in the code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants