Skip to content

Commit

Permalink
Upgrade USWDS to 2.12
Browse files Browse the repository at this point in the history
**Why:** Avoid future maintenance overhead incurred by version drift, incorporate latest features and updates, including upstream contributions previously implemented as overrides.

Changelog:
- https://github.com/uswds/uswds/releases/tag/v2.12.1
- https://github.com/uswds/uswds/releases/tag/v2.12.0

Incorporated revisions:
- uswds/uswds#4199
- uswds/uswds#4286
  • Loading branch information
aduth committed Aug 25, 2021
1 parent af4d3ba commit d752615
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 97 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

- Whitespace in checkbox and radio label markup will no longer cause the label text to be misplaced.
- Margins surrounding an external link icon have been increased slightly.
- USWDS is upgraded to the latest version, from v2.11.2 to v2.12.1.

## 6.0.0

Expand Down
148 changes: 70 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -59,7 +59,7 @@
},
"homepage": "https://github.com/18F/identity-style-guide#readme",
"dependencies": {
"uswds": "^2.11.2"
"uswds": "^2.12.1"
},
"devDependencies": {
"@babel/core": "^7.14.3",
Expand Down
32 changes: 16 additions & 16 deletions src/scss/components/_inputs.scss
@@ -1,5 +1,6 @@
$theme-input-tile-background-color: 'transparent'; // https://github.com/uswds/uswds/pull/4199
$theme-input-bordered-background-color: $theme-input-tile-background-color;
$theme-input-tile-background-color-selected: 'primary-lightest';
$theme-input-tile-border-color: 'primary-light';
$theme-input-tile-border-color-selected: 'primary-light';
$theme-input-bordered-background-color-selected: $theme-input-tile-background-color-selected;
$theme-input-bordered-border-radius: $theme-input-tile-border-radius;
$theme-input-bordered-border-width: $theme-input-tile-border-width;
Expand Down Expand Up @@ -75,27 +76,21 @@ $input-select-margin-right: 1;

.usa-radio__label,
.usa-checkbox__label {
@extend %block-input-general;
display: inline-block;
margin-bottom: units(1);
padding-left: $checkbox-radio-size + units($input-select-margin-right);
text-indent: 0;

&::before {
background-color: color('primary-lightest');
box-shadow: inset 0 0 0 units($border-width) color('primary');
display: block;
height: $checkbox-radio-size;
left: 0;
margin-left: 0;
margin-right: 0;
margin-top: (
line-height($theme-form-font-family, $theme-input-line-height) *
font-size($theme-form-font-family, $theme-body-font-size) -
$checkbox-radio-size
) / 2;
position: absolute;
white-space: normal;
width: $checkbox-radio-size;
}
}
Expand Down Expand Up @@ -160,34 +155,39 @@ $input-select-margin-right: 1;
.usa-radio__input--tile + .usa-radio__label {
@include u-text('primary', 'bold');
@include u-display('block');
background-color: color($theme-input-tile-background-color); // https://github.com/uswds/uswds/pull/4178
border-color: color($theme-input-tile-border-color);
max-width: units($theme-input-max-width);
}

.usa-radio__input--bordered + .usa-radio__label,
.usa-checkbox__input--bordered + .usa-checkbox__label {
@include u-display('table'); // Margin collapse of a "block" while retaining collapsed width.
background-color: color($theme-input-bordered-background-color);
border: units($theme-input-bordered-border-width) solid color($theme-input-bordered-border-color);
border-radius: radius($theme-input-bordered-border-radius);
margin: units(1) 0;
max-width: units($theme-input-max-width);
padding: units(1) units(2) units(1) #{units(2) + $checkbox-radio-size + units($input-select-margin-right)};
}

.usa-radio__input--bordered:checked + .usa-radio__label,
.usa-checkbox__input--bordered:checked + .usa-checkbox__label {
background-color: color($theme-input-bordered-background-color-selected);
border-color: color($theme-input-bordered-border-color-selected);
}

.usa-checkbox__input--tile:checked + .usa-checkbox__label,
.usa-radio__input--tile:checked + .usa-radio__label {
background-color: color($theme-input-tile-background-color-selected);
border-color: color($theme-input-tile-border-color-selected);
}

.usa-checkbox__input--tile + .usa-checkbox__label::before,
.usa-radio__input--tile + .usa-radio__label::before,
.usa-radio__input--bordered + .usa-radio__label::before,
.usa-checkbox__input--bordered + .usa-checkbox__label::before {
left: units(2);
}

.usa-checkbox__input--bordered:checked + .usa-checkbox__label,
.usa-radio__input--bordered:checked + .usa-radio__label {
background-color: color($theme-input-bordered-background-color-selected);
border-color: color($theme-input-bordered-border-color-selected);
}

.usa-checkbox__label-description,
.usa-radio__label-description {
@include typeset(
Expand Down
2 changes: 0 additions & 2 deletions src/scss/uswds-theme/_components.scss
Expand Up @@ -37,7 +37,5 @@ $theme-footer-font-family: 'body';
// Form and input
$theme-checkbox-border-radius: 1.5px;
$theme-input-line-height: 3;
$theme-input-tile-background-color-selected: 'primary-lightest';
$theme-input-tile-border-radius: 'lg';
$theme-input-tile-border-width: 1px;
$theme-input-tile-border-color: 'primary-light';

0 comments on commit d752615

Please sign in to comment.