Skip to content

Commit bb8564d

Browse files
authored
Merge pull request #43 from uswds/jm-runthru-edits
Extend: Additional copy edits
2 parents d73deb8 + ddfb23a commit bb8564d

4 files changed

Lines changed: 38 additions & 35 deletions

File tree

_includes/sxs/02-extending/part-one.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h3 class="step">Customize border settings.</h3>
1818
Let's start with the card border. We'll remove the border and make the card rounder by increasing the border radius.
1919
</p>
2020
<p class="step-description">
21-
We want to give our card a border radius of 2 units. To do that we'll set the value of the border radius to <strong>lg</strong> then set the value of the large border radius to 2.
21+
We want to give our card a border radius of 2 units. To do that we'll set the value of the global border radius to <strong>lg</strong> then set the value of the large border radius to 2.
2222
</p>
2323
<div class="editor">
2424
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/_uswds-theme.scss</h4>

_includes/sxs/02-extending/part-three.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
2222
</p>
2323
<div class="editor">
2424
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _includes/testimonial.html</h4>
25-
<pre class="blur">&lt;div class="my-testimonial"&gt;</pre>
26-
<pre class="add"> &lt;div class="my-testimonial__body"&gt;
27-
&lt;p&gt;
25+
<pre class="blur">&lt;div class="my-testimonial"&gt;
26+
&lt;div class="my-testimonial__body"&gt;</pre>
27+
<pre class="add"> &lt;p&gt;
2828
“One of the best USWDS tutorials I’ve followed all the way to the end.”
29-
&lt;/p&gt;
30-
&lt;/div&gt;</pre>
31-
<pre class="blur"> &lt;div class="my-testimonial__footer"&gt;&lt;/div&gt;
29+
&lt;/p&gt;</pre>
30+
<pre class="blur"> &lt;/div&gt;
31+
&lt;div class="my-testimonial__footer"&gt;&lt;/div&gt;
3232
&lt;/div&gt;
3333
</pre>
3434
</div>
@@ -46,7 +46,9 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
4646
&lt;p class="my-testimonial__profile-title"&gt;Participant&lt;/p&gt;
4747
&lt;/div&gt;
4848
</pre>
49-
<pre class="blur">&lt;/div&gt;</pre>
49+
<pre class="blur"> &lt;/div&gt;
50+
&lt;/div&gt;
51+
</pre>
5052
</div>
5153
<p class="step-description">
5254
Lastly, let's add a quotation icon for some visual flare! Visit the <a href="https://designsystem.digital.gov/components/icon/">Icon component</a> page, search for <strong>quote</strong>, and click the search result to copy the icons markup. Paste this markup directly after the opening <strong>my-testimonial</strong> div.
@@ -106,15 +108,15 @@ <h3 class="step">Add stylesheet partial.</h3>
106108
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/_uswds-theme-custom-styles.scss</h4>
107109
<pre class="blur">@use "uswds-core" as *;
108110
@forward "../assets/css/styles.scss";
109-
@forward "../_theme/components/_my-card.scss";
110-
</pre><pre class="add">@forward "../_theme/components/_my-testimonial.scss";</pre>
111+
@forward "components/_my-card.scss";
112+
</pre><pre class="add">@forward "components/_my-testimonial.scss";</pre>
111113
</div>
112114
<h3 class="step">Start styling the component.</h3>
113115
<p class="step-description">
114116
Just like using the <strong>color()</strong> function to use USWDS color tokens, we can use <strong>units()</strong> and other token functions to use tokens in native CSS properties. To get our base styles for our new component, add the following styles to the new stylesheet:
115117
</p>
116118
<div class="editor">
117-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
119+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
118120
<pre class="add">
119121
@use "uswds-core" as *;
120122

@@ -147,7 +149,7 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
147149
}
148150

149151
.my-testimonial__profile {
150-
margin-left: units(3)
152+
margin-left: units(3);
151153
}
152154

153155
.my-testimonial__profile-title {
@@ -165,7 +167,7 @@ <h3 class="step">Style the testimonial icon.</h3>
165167
USWDS uses variables to maintain consistent styles across different definitions. Let's create a variable for our icon stroke and fill at the top of our stylesheet.
166168
</p>
167169
<div class="editor">
168-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
170+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
169171
<pre class="blur">@use "uswds-core" as *;
170172

171173
</pre>
@@ -194,7 +196,7 @@ <h3 class="step">Using USWDS theme tokens with mixins.</h3>
194196
Using a combination of utility mixins and USWDS theme settings can help add uniformity across your project. In this example, we'll add the border settings and padding settings from earlier to help our new component sit nicely with the original card. The <strong>u-margin-x()</strong> mixin lets you set left and right margin at the same time.
195197
</p>
196198
<div class="editor">
197-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
199+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
198200
<pre class="blur">.my-testimonial {</pre>
199201
<pre class="add"> @include u-border($theme-card-border-width);
200202
@include u-margin-x(1);
@@ -212,7 +214,7 @@ <h3 class="step">Adjusting color, background, and contrast.</h3>
212214
Finally, let's change the color of our testimonial component. The traditional way to set background and color is to use two separate rules. If we want to use our primary colors in this component, we can use the following two rules:
213215
</p>
214216
<div class="editor">
215-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
217+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
216218
<pre class="blur">.my-testimonial {
217219
@include u-border($theme-card-border-width);
218220
@include u-margin-x(1);
@@ -234,7 +236,7 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
234236
</p>
235237

236238
<div class="editor">
237-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
239+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
238240
<pre class="blur">.my-testimonial {
239241
@include u-border($theme-card-border-width);
240242
@include u-margin-x(1);
@@ -249,7 +251,7 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
249251
This time, when you save and compile you'll see a warning in the terminal. Let's update our code to use <strong>primary-lighter</strong> as our text color.
250252
</p>
251253
<div class="editor">
252-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-testimonial.scss</h4>
254+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-testimonial.scss</h4>
253255
<pre class="blur">.my-testimonial {
254256
@include u-border($theme-card-border-width);
255257
@include u-margin-x(1);

_includes/sxs/02-extending/part-two.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h3 class="step">Import the new stylesheet into USWDS custom styles.</h3>
5151
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/_uswds-theme-custom-styles.scss</h4>
5252
<pre class="blur">@use "uswds-core" as *;
5353
@forward "../assets/css/styles.scss";
54-
</pre><pre class="add">@forward "../_theme/components/_my-card.scss";</pre>
54+
</pre><pre class="add">@forward "components/_my-card.scss";</pre>
5555
</div>
5656
<p class="step-description">
5757
Once you've updated this file, you can save and close it. Since we've added our project Sass source directory to our gulpfile in the first part of the tutorial, it should already be compiling correctly!
@@ -65,7 +65,7 @@ <h3 class="step">Use USWDS core features in custom styles.</h3>
6565
We'll want to use USWDS design tokens in our stylesheets using USWDS style features like functions and mixins. To do this, lets add <strong>uswds-core</strong> to the top of our new stylesheet with the <strong>use</strong> Sass directive.
6666
</p>
6767
<div class="editor">
68-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-card.scss</h4>
68+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-card.scss</h4>
6969
<pre class="add">@use "uswds-core" as *;</pre>
7070
</div>
7171

@@ -74,7 +74,7 @@ <h3 class="step">Add custom class and styles.</h3>
7474
Next lets create a custom class for our personalized component and use some USWDS utilities. We'll start by updating the background color of the card. We can use the <a href="https://designsystem.digital.gov/design-tokens/color/system-tokens/#using-color-tokens-2"><strong>color()</strong> function</a> to use color tokens in our CSS rules.
7575
</p>
7676
<div class="editor">
77-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-card.scss</h4>
77+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-card.scss</h4>
7878
<pre class="add">.my-card .usa-card__container {
7979
background-color: color("yellow-10");
8080
}</pre>
@@ -83,7 +83,7 @@ <h4 class="filename"><span class="material-icons" aria-hidden="true">description
8383
After recompiling we can see our changes have taken effect. Let's refine this card a bit more by reducing the boldness of the header and adding bit more space before the call to action. We'll use <a href="https://designsystem.digital.gov/design-tokens/spacing-units/">units tokens</a> and <a href="https://designsystem.digital.gov/design-tokens/typesetting/font-weight/">font weight tokens</a> for this.
8484
</p>
8585
<div class="editor">
86-
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> assets/css/components/_my-card.scss</h4>
86+
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/components/_my-card.scss</h4>
8787
<pre class="blur">.my-card .usa-card__container {
8888
background-color: color("indigo-70v");
8989
}

assets/css/styles.scss

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
}
4646
}
4747

48-
:where(html) {
48+
:where(html) {
4949
color: var(--text-2);
5050
background-color: var(--surface-1);
5151
}
5252

53-
:where(h1, h2, h3, h4, h5, h6, dt) {
53+
:where(h1, h2, h3, h4, h5, h6, dt) {
5454
color: var(--text-1);
5555
}
5656

@@ -103,7 +103,7 @@
103103
}
104104
}
105105

106-
:where(body) {
106+
:where(body) {
107107
min-block-size: 100%;
108108
scrollbar-gutter: stable both-edges;
109109
}
@@ -113,13 +113,13 @@
113113
font-weight: var(--font-weight-9);
114114
}
115115

116-
:is(h1) {
117-
font-size: var(--font-size-8);
118-
max-inline-size: var(--size-header-1);
116+
:is(h1) {
117+
font-size: var(--font-size-8);
118+
max-inline-size: var(--size-header-1);
119119
}
120120

121-
:is(h2) {
122-
font-size: var(--font-size-6);
121+
:is(h2) {
122+
font-size: var(--font-size-6);
123123
max-inline-size: var(--size-header-2);
124124
}
125125

@@ -210,10 +210,10 @@
210210
:is(code, kbd, samp, pre) { font-family: var(--font-mono) }
211211
:where(:not(pre) > code, kbd) { white-space: nowrap }
212212

213-
:is(pre) {
213+
:is(pre) {
214214
white-space: pre;
215215
min-inline-size: 0;
216-
max-inline-size: max-content;
216+
max-inline-size: max-content;
217217
}
218218

219219
:where(:not(pre) > code) {
@@ -244,8 +244,8 @@
244244
margin-block-start: var(--size-5);
245245
}
246246

247-
:where(small) {
248-
font-size: max(.5em, var(--font-size-0));
247+
:where(small) {
248+
font-size: max(.5em, var(--font-size-0));
249249
max-inline-size: var(--size-content-1);
250250
}
251251

@@ -442,6 +442,7 @@ main .part.intro {
442442
}
443443

444444
.part.intro > h1 {
445+
color: white;
445446
padding-top: var(--size-7)
446447
}
447448

@@ -581,7 +582,7 @@ main p a:active {
581582
padding-top: var(--size-2);
582583
}
583584

584-
.terminal,
585+
.terminal,
585586
.editor {
586587
font-size: var(--font-size-3);
587588
padding: var(--size-3);
@@ -752,4 +753,4 @@ a.contents-item:hover {
752753

753754
.contents-item .material-icons {
754755
margin-left: var(--size-1);
755-
}
756+
}

0 commit comments

Comments
 (0)