Skip to content

Commit

Permalink
Begin building out part 2 instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneycm committed Mar 18, 2024
1 parent 7576929 commit 80441b4
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
16 changes: 16 additions & 0 deletions _includes/sxs/02-extending/card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

<div class="usa-card position-sticky top-1">
<div class="usa-card__container">
<div class="usa-card__header">
<h2 class="usa-card__heading">Card component</h2>
</div>
<div class="usa-card__body">
<p>
This is a standard USWDS card component! Customize me!
</p>
</div>
<div class="usa-card__footer">
<a href="#" class="usa-button">Card button</a>
</div>
</div>
</div>
29 changes: 29 additions & 0 deletions _includes/sxs/02-extending/part-intro.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<section class="part intro">
<h2>Theming, customizing, extending</h2>
<p class="subhed">Take USWDS and make it your own.</p>
<p class="subhed">In this section of the tutorial, you'll expand on theming components. Then you'll learn creating custom project styles for our components. Finally, you'll exend a component to create a custom component!</p>
<h3>Contents</h3>
<ul class="contents">
<li>
<a class="contents-item" href="#part-one">
<span class="contents-part">1</span>
<span class="contents-title">Theming USWDS Components</span>
<span class="material-icons right" aria-hidden="true">arrow_forward</span>
</a>
</li>
<li>
<a class="contents-item" href="#part-one">
<span class="contents-part">2</span>
<span class="contents-title">Writing custom styles</span>
<span class="material-icons right" aria-hidden="true">arrow_forward</span>
</a>
</li>
<li>
<a class="contents-item" href="#part-one">
<span class="contents-part">3</span>
<span class="contents-title">Extending USWDS components</span>
<span class="material-icons right" aria-hidden="true">arrow_forward</span>
</a>
</li>
</ul>
</section>
45 changes: 45 additions & 0 deletions _includes/sxs/02-extending/part-one.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
\<section class="part one" id="part-one">
<h2><span>Part one</span> Customize card using theme settings</h2>
<p>
We’ll start customizing our card component by using the available theme settings.
</p>
<h3 class="step">View available theme settings.</h3>
<p class="step-description">
Visit the <a href="https://designsystem.digital.gov/components/card/#usability-guidance">USWDS Card component settings table</a> to see a list of available settings.
</p>
<h3 class="step">Customize border settings</h3>
<p class="step-description">
Let's start but updating the border color and radius to be more pronounced.
</p>
<div class="editor">
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/_uswds-theme.scss</h4>
<pre class="blur">@use "uswds-core" with (
...
</pre><pre class="add"> $theme-card-border-color: "indigo-30",
$theme-card-border-radius: 3,
$theme-card-border-width: 1</pre>
<pre class="blur">);</pre>
</div>
<h3 class="step">Customize type settings</h3>
<p class="step-description">
Next lets use the available font and typeset settings to customize how our card information is presented.
</p>
<div class="editor">
<h4 class="filename"><span class="material-icons" aria-hidden="true">description</span> _theme/_uswds-theme.scss</h4>
<pre class="blur">@use "uswds-core" with (
...
$theme-card-border-color: "indigo-30",
$theme-card-border-radius: 3,
$theme-card-border-width: 1,</pre>
<pre class="add"> $theme-card-font-family: "serif"
$theme-card-header-typeset: "sans", "xl", 2.5
</pre><pre class="blur">);</pre>
</div>
<p class="step-description">
Save, wait for he Sass to compile, and do a hard reload and you'll see the the updated border and font settings shape the card component! All without having to write any custom CSS.
</p>

<p class="step-description">
But maybe there are additional changes your team would like to make that are not available in theme settings. In the next section we'll take a look at USWDS.
</p>
</section>
14 changes: 13 additions & 1 deletion pages/02-extending/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
{% include "hero.html" with page.hero %}
</header>
<main id="tutorial-start">
We'll include Building exercises here.
<div class="grid-container maxw-full">
<div class="grid-row">
{% include "sxs/02-extending/part-intro.html" %}
<div class="grid-col-7">
{% include "sxs/02-extending/part-one.html" %}
{% include "sxs/02-extending/part-two.html" %}
{% include "sxs/02-extending/part-three.html" %}
</div>
<div class="demo-display grid-col-5">
{% include "sxs/02-extending/card.html" %}
</div>
</div>
</div>
</main>
{% include "footer.html" %}

0 comments on commit 80441b4

Please sign in to comment.