Skip to content

Fix active, disabled, unstyled button background color#4881

Merged
aduth merged 2 commits into
mainfrom
aduth-fix-active-disabled-unstyled-button
Apr 6, 2021
Merged

Fix active, disabled, unstyled button background color#4881
aduth merged 2 commits into
mainfrom
aduth-fix-active-disabled-unstyled-button

Conversation

@aduth

@aduth aduth commented Apr 5, 2021

Copy link
Copy Markdown
Contributor

Why: When an unstyled button is used as the submit button in a form, it can cause an issue where clicking the button would make it both disabled and active. This is because our default form validation will disable all submit buttons when a form is submitted. Since this happens at the same time as the link activation, and since the USWDS default disabled button styles conflict with the unstyled link appearance, an undesirable background color can be shown.

Problematic base styles: https://github.com/uswds/uswds/blob/0f1f4d0/src/stylesheets/core/mixins/_button-disabled.scss#L7-L16

Before After
image image

aduth added 2 commits April 5, 2021 16:58
**Why**: When an unstyled button is used as the submit button in a form, it can cause an issue where clicking the button would make it both disabled and active. This is because our default form validation will disable all submit buttons when a form is submitted. Since this happens at the same time as the link activation, and since the USWDS default disabled button styles conflict with the unstyled link appearance, an undesirable background color can be shown.
@aduth aduth merged commit 7d0431e into main Apr 6, 2021
@aduth aduth deleted the aduth-fix-active-disabled-unstyled-button branch April 6, 2021 12:26
aduth added a commit that referenced this pull request May 4, 2021
* Fix active, disabled, unstyled button background color

**Why**: When an unstyled button is used as the submit button in a form, it can cause an issue where clicking the button would make it both disabled and active. This is because our default form validation will disable all submit buttons when a form is submitted. Since this happens at the same time as the link activation, and since the USWDS default disabled button styles conflict with the unstyled link appearance, an undesirable background color can be shown.

* Match full selector chain from disabled styles
aduth added a commit that referenced this pull request May 4, 2021
* Fix active, disabled, unstyled button background color

**Why**: When an unstyled button is used as the submit button in a form, it can cause an issue where clicking the button would make it both disabled and active. This is because our default form validation will disable all submit buttons when a form is submitted. Since this happens at the same time as the link activation, and since the USWDS default disabled button styles conflict with the unstyled link appearance, an undesirable background color can be shown.

* Match full selector chain from disabled styles
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