Skip to content

Commit db370b4

Browse files
authored
Merge pull request #1198 from uswds/je-docs-incorrect-grid-width-var
USWDS - Docs: Replace deprecated `$theme-site-max-width` variable.
2 parents 708c690 + 9965369 commit db370b4

File tree

8 files changed

+9
-23
lines changed

8 files changed

+9
-23
lines changed

_data/migration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ variables:
11571157
notes:
11581158
- v1: '$site-max-width'
11591159
v1_value: '1040px'
1160-
v2: '$theme-site-max-width'
1160+
v2: '$theme-grid-container-max-width'
11611161
v2_value: 'desktop'
11621162
kind: 'units'
11631163
location: 'spacing'
@@ -1462,4 +1462,4 @@ units:
14621462
mixin: u-margin-top(5)
14631463
utility: .margin-top-5
14641464
setting: 5
1465-
value: 40px
1465+
value: 40px

_data/settings.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,6 @@
989989
default: "'desktop'"
990990
kind: units
991991

992-
- name: Site max width
993-
section: true
994-
usage: Used to set a consistent `max-width` across components.
995-
var: $theme-site-max-width
996-
default: "'desktop'"
997-
kind: units
998992
- name: Site outer margins breakpoint
999993
usage: At what breakpoint should the site's outer margin change.
1000994
var: $theme-site-margins-breakpoint

_data/settings/spacing.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ contents:
5454
default: '"desktop"'
5555
type: units
5656

57-
- name: Site max width
58-
section: true
59-
description: Used to set a consistent `max-width` across components
60-
var: $theme-site-max-width
61-
default: '"desktop"'
62-
type: units
6357
- name: Site outer margins breakpoint
6458
description: The breakpoint at which the site's outer margin changes
6559
var: $theme-site-margins-breakpoint

_utilities/layout-grid.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Breaking it down, here's how it works:
6565

6666
{:.usa-content-list}
6767
- **Containers:** `grid-container` centers the container and gives it a maximum width of `desktop` (1024px). If you would like the grid to span the full width of the page, do not use `grid-container`.
68-
- `grid-container` can also accept any breakpoint width like `grid-container-tablet-lg` or `grid-container-widescreen`. Set the default max width with `$theme-site-max-width` in `uswds-theme-spacing.scss`.
68+
- `grid-container` can also accept any breakpoint width like `grid-container-tablet-lg` or `grid-container-widescreen`. Set the default max width with `$theme-grid-container-max-width` in `uswds-theme-spacing.scss`.
6969
- By default, `grid-container`s have padding-x of [2 units]({{ site.baseurl }}/design-tokens/spacing-units/){:.token}, with a padding-x of [4 units]({{ site.baseurl }}/design-tokens/spacing-units/){:.token} at `desktop` and wider. Control these values with the values of `$theme-site-margins-mobile-width`, `$theme-site-margins-width` and `$theme-site-margins-beakpoint` in `uswds-theme-spacing.scss`.
7070
- **Rows:** Columns must have a `grid-row` as a parent.
7171
- **Columns:** `grid-col-[1-12]` indicates the number of columns the item spans out of a possible 12 per row. So, if you want three equal-width columns across, use `grid-col-4` for each item.
@@ -515,7 +515,6 @@ $theme-column-gap-lg: 3;
515515
$theme-column-gap-mobile: 2;
516516
$theme-column-gap-desktop: 4;
517517
$theme-grid-container-max-width: 'desktop';
518-
$theme-site-max-width: 'desktop';
519518
$theme-site-margins-breakpoint: 'desktop';
520519
$theme-site-margins-width: 4;
521520
$theme-site-margins-mobile-width: 2;

css/_uswds-theme-custom-styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ body {
510510
.styleguide-content {
511511
@include add-responsive-site-margins;
512512
margin-bottom: units(6);
513-
max-width: units($theme-site-max-width);
513+
max-width: units($theme-grid-container-max-width);
514514
position: relative;
515515

516516
header {

css/settings/_uswds-theme-spacing.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Site
8787
----------------------------------------
8888
*/
8989

90-
$theme-site-max-width: 'widescreen';
9190
$theme-site-margins-breakpoint: 'desktop';
9291
$theme-site-margins-width: 4;
9392
$theme-site-margins-mobile-width: 2;

pages/design-tokens/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ We can't include tokens directly in our Sass, like `max-width: 1`, rather we use
5656
Tokens can, themselves, be expressed as variables. And this is how most USWDS theme settings work. For instance, the following is an example of theme settings from `_uswds-theme-spacing.scss` showing settings variables assigned spacing unit tokens:
5757

5858
```
59-
$theme-site-max-width: 'desktop';
59+
$theme-grid-container-max-width: 'desktop';
6060
$theme-site-margins-breakpoint: 'desktop';
6161
$theme-site-margins-width: 4;
6262
$theme-site-margins-mobile-width: 2;
@@ -67,7 +67,7 @@ USWDS component Sass uses those variableized tokens to build component styles:
6767
```
6868
.usa-example {
6969
@include u-padding-x($theme-site-margins-mobile-width);
70-
max-width: units($theme-site-max-width);
70+
max-width: units($theme-grid-container-max-width);
7171
7272
@include at-media($theme-site-margins-breakpoint) {
7373
@include u-padding-x($theme-site-margins-width);
@@ -109,7 +109,7 @@ In general, USWDS sets variables with tokens, and passes those variables into fu
109109

110110
## Using design tokens
111111

112-
Use design tokens directly to set the value of settings variables in USWDS theme settings files, like `$theme-site-max-width: 'desktop'`. Otherwise, use functions, mixins, or utility classes as in the examples below. See individual design token section for more details.
112+
Use design tokens directly to set the value of settings variables in USWDS theme settings files, like `$theme-grid-container-max-width: 'desktop'`. Otherwise, use functions, mixins, or utility classes as in the examples below. See individual design token section for more details.
113113

114114
### Color
115115
<div class="site-table-wrapper">

pages/documentation/getting-started/migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The [design tokens]({{ site.baseurl }}/design-tokens/) section of the documentat
6262
Settings variables are assigned design tokens.
6363

6464
```sass
65-
$theme-site-max-width: 'desktop';
65+
$theme-grid-container-max-width: 'desktop';
6666
$theme-site-margins-breakpoint: 'desktop';
6767
$theme-site-margins-width: 4;
6868
$theme-site-margins-mobile-width: 2;
@@ -75,7 +75,7 @@ We use tokens (or tokens expressed as variables) in mixins and functions.
7575
```sass
7676
.usa-example {
7777
@include u-padding-x($theme-site-margins-mobile-width);
78-
max-width: units($theme-site-max-width);
78+
max-width: units($theme-grid-container-max-width);
7979
8080
@include at-media($theme-site-margins-breakpoint) {
8181
@include u-padding-x($theme-site-margins-width);

0 commit comments

Comments
 (0)