Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev guide updates uswds compile #1424

Merged
merged 28 commits into from Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8517073
MS hyphenation correction
mikki-stacey Feb 2, 2022
4cb44f6
MS "lead" correction.
mikki-stacey Feb 2, 2022
a2e3d82
Consistency update.
mikki-stacey Feb 2, 2022
043668e
Consistency updates
mikki-stacey Feb 2, 2022
16bd598
Revisions to intro and step 1
mikki-stacey Feb 2, 2022
6ace404
Updated Step 2 through Step 5
mikki-stacey Feb 3, 2022
5f3becb
Compile updats
mikki-stacey Feb 3, 2022
6ff59c8
Inclusive language review.
mikki-stacey Feb 4, 2022
23329a6
Pulled in tables from compile README
mikki-stacey Feb 4, 2022
5526f9f
Overrides folder rec
mikki-stacey Feb 4, 2022
5d344a8
Merge branch 'main' of github.com:uswds/uswds-site into dev-guide-upd…
mejiaj Feb 17, 2022
20848c9
Remove extra space in the showcase link
amyleadem Feb 17, 2022
d151f18
Typo correction
mikki-stacey Feb 17, 2022
2620601
Merge branch 'main' of github.com:uswds/uswds-site into dev-guide-upd…
mejiaj Mar 8, 2022
0e74d81
Use SASS imports in code example.
mejiaj Mar 9, 2022
0052882
Remove uswds-gulp references; fix typo
mejiaj Mar 9, 2022
97097bf
Update references to SASS path
mejiaj Mar 9, 2022
e703b1b
Replace additonal uswds-gulp references
mejiaj Mar 9, 2022
cb28e21
Comma revision
mikki-stacey Mar 9, 2022
00d6363
Removed "below"
mikki-stacey Mar 9, 2022
6291ebc
Update compile task name
mejiaj Mar 9, 2022
46d2ea6
Deleted "and all its dependencies"
mikki-stacey Mar 9, 2022
0bd5818
Phase 2: Update side navigation titles to match content
amyleadem Mar 9, 2022
26b87f5
Phase 2: set path settings table to be scrollable
amyleadem Mar 9, 2022
dcf883e
Update ruby and snyk config; merge main
amyleadem Mar 9, 2022
ed51dbd
repair link on maturity model page
amyleadem Mar 9, 2022
8a1adf5
Merge branch 'main' of https://github.com/uswds/uswds-site into dev-g…
amyleadem Mar 10, 2022
f986af3
Phase 2: Add tabindex to scrollable table
amyleadem Mar 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions pages/documentation/getting-started-developers/overview.md
Expand Up @@ -2,7 +2,7 @@
permalink: /documentation/getting-started-for-developers/
layout: styleguide
title: Getting started for developers
lead: Get started using the design system by installing, compiling, and customizing USWDS code
lead: Get started using the Design System by installing, compiling, and customizing our code.
category: How to use USWDS
type: docs
subnav:
Expand All @@ -14,25 +14,25 @@ redirect_from:
- /documentation/fundamentals/
---

Getting started for developers will lead you, step-by-step, through the process of installing and compiling the Design System and customizing your project using components and design tokens. If you prefer a hands-on demonstration of this process, please check out [our interactive tutorial](https://github.com/uswds/uswds-tutorial), which will take you through the same steps using a pre-made example website.
Getting started for developers will lead you, step by step, through the process of installing and compiling the U.S. Web Design System and customizing your project using components and design tokens. If you prefer a hands-on demonstration of this process, please check out [our interactive tutorial](https://github.com/uswds/uswds-tutorial), which will take you through the same steps using a pre-made example website.

As always, we're here for you if you have any questions. Please get in touch via GitHub, Slack, or email!


## What you need
We recommend using the following tools when working with USWDS:
We recommend using the following tools when working with the Design System:
- Node (use the version specified in the [.nvmrc file](https://github.com/uswds/uswds/blob/main/.nvmrc); if needed, [download the latest version](https://nodejs.org/en/download/) from Node.js)
- npm
- Sass (we use [the latest `sass` package from npm](https://www.npmjs.com/package/sass))

These step-by-step instructions describe how to get started with USWDS using npm (recommended method).
These step-by-step instructions describe how to get started with the Design System using npm (recommended method).

If npm is not a viable tool for your project, however, you can [download and install the system directly](https://github.com/uswds/uswds#download-and-install) as outlined in GitHub.
If npm is not a viable tool for your project, however, you can [download and install the Design System directly](https://github.com/uswds/uswds#download-and-install) as outlined in GitHub.

We’ve designed USWDS to support older and newer browsers through [progressive enhancement](https://en.wikipedia.org/wiki/Progressive_enhancement). The design system follows the [2% rule](https://gds.blog.gov.uk/2012/01/25/support-for-browsers/): we officially support any browser above 2% usage as observed by [analytics.usa.gov](https://analytics.usa.gov/). In other words, USWDS version 2.0 supports Chrome, Firefox, Safari, Edge, and Internet Explorer 11 and up. The next major version of USWDS (3.0) will drop support of Internet Explorer 11.
We’ve built the Design System to support older and newer browsers through [progressive enhancement](https://en.wikipedia.org/wiki/Progressive_enhancement). We follow the [2% rule](https://gds.blog.gov.uk/2012/01/25/support-for-browsers/): we officially support any browser above 2% usage as observed by [analytics.usa.gov](https://analytics.usa.gov/). In other words, Design System version 2.0 supports Chrome, Firefox, Safari, Edge, and Internet Explorer 11 and up. The next major version of the Design System (3.0) will drop support of Internet Explorer 11.

## Step-by-step
Get started with USWDS by installing the design system on your project, compiling your project's Sass from the USWDS source, and customizing the design system to fit your project needs as outlined in the following phases:
Get started by installing the Design System on your project, compiling your project's Sass from the Design System source, and customizing the Design System to fit your project needs as outlined in the following phases:

[**Phase 1: Install**]({{ site.baseurl }}/documentation/getting-started/developers/phase-one-install/) →

Expand Down
20 changes: 7 additions & 13 deletions pages/documentation/getting-started-developers/phase-one.md
Expand Up @@ -3,7 +3,7 @@ permalink: /documentation/getting-started/developers/phase-one-install/
layout: styleguide
title: "Phase 1: Install"
category: How to use USWDS
lead: Install design system files and source code into your project
lead: Install Design System files and source code into your project.
type: docs
subnav:
- text: "Step 1: Install Node and npm"
Expand All @@ -14,23 +14,17 @@ subnav:
href: "#step-3-install-uswds"
---

USWDS distributes our source code through npm, a package manager that uses a flavor of JavaScript called Node.js. The best way to add USWDS to your project is with npm via a Terminal window (see tips for using Terminal on a [Mac](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac) or [Windows](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab)).
The U.S. Web Design System distributes our source code through npm, a package manager that uses a flavor of JavaScript called Node.js. The best way to add the Design System to your project is with npm via a Terminal window (check out some tips for using Terminal on a [Mac](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac) or [Windows](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab)).

Installing USWDS with Node and npm not only allows you to install all the code the design system needs to compile with just a couple commands, but using npm will version any installed packages, like USWDS, as well — meaning your project code is tied to a specific version of the design system. Confirming what version of the design system you’re using and updating to a newer (or older) version of the design system is straightforward.
Installing the Design System with Node and npm not only allows you to install all the code the Design System needs to compile with just a couple commands, but will version any installed packages, like USWDS, as well — meaning your project code is tied to a specific version of the Design System. Confirming what version you’re using and updating to a newer (or older) version is straightforward.

## Step 1: Install Node and npm
Open your Terminal application and a Terminal window. Check to see if you have the [most recent version of Node](https://github.com/uswds/uswds/blob/develop/.nvmrc) installed with `node -v`. You should see the following message in Terminal:
Open your Terminal application and a Terminal window. Check to see if you have the [most recent version of Node](https://github.com/uswds/uswds/blob/develop/.nvmrc) installed with `node -v`.

{:.site-terminal}
```bash
node -v
# v12.16.1 [or higher]
```

If you don’t have Node, install it from [https://nodejs.org/en/download/](https://nodejs.org/en/download/).
If you don’t have Node, install it from [Node.js](https://nodejs.org/en/download/).

## Step 2: Initialize your project in Node
Once you have Node and npm installed, go to the root of your project directory in Terminal. The root is the topmost directory associated with your project, the directory that includes all your project files and directories. The root will appear in Terminal as follows:
Once you have Node and npm installed, go to the root of your project directory in Terminal. The root is the topmost directory associated with your project, the directory that includes all your project files and directories. In Terminal, the root will read as follows:

{:.site-terminal}
```bash
Expand All @@ -48,7 +42,7 @@ npm init
# ...
```

This initialization will start a series of prompts at the command line. Usually the defaults (which are noted in parentheses) are okay for a simple project. You can always edit these values later. Once this process is finished, you’ll have a new package.json file in the root, which will appear as follows:
This initialization will start a series of prompts at the command line. Usually the defaults (which are noted in parentheses) are okay for a simple project. You can always edit these values later. Once this process is finished, you’ll have a new package.json file in the root, which will read as follows:

{:.site-terminal}
```bash
Expand Down
14 changes: 8 additions & 6 deletions pages/documentation/getting-started-developers/phase-three.md
Expand Up @@ -3,26 +3,28 @@ permalink: /documentation/getting-started/developers/phase-three-customize/
layout: styleguide
title: "Phase 3: Customize"
category: How to use USWDS
lead: Customize the design system with settings and custom code
lead: Customize the Design System with settings and custom code.
type: docs
---

Now, equipped with building blocks that are accessible and cohesive, you can get creative. Here is an overview of what you need to know to customize your project:
Now, equipped with building blocks that are accessible and cohesive, you can get creative. This phase is an overview of what you need to know to customize your project.

{: .site-note }
**Note:** If you use `uswds-gulp`, as detailed in Phase 2, this tool adds each of the files mentioned below to the directory you specify in `PROJECT_SASS_SRC`.
**Note:** If you use `uswds-compile`, as detailed in Phase 2, this tool adds each of the files mentioned below to the directory you specify in `uswds.paths.dist.theme`.

USWDS provides extensive support for theming via its theme settings files. The critical files you'll need in your project are the following, which are located in `dist/scss/theme`:
The U.S. Web Design System provides extensive support for theming via its theme settings files. The files you'll need in your project are the following, which are located in `uswds.paths.dist.theme`:
- `_uswds-theme-color.scss` — color settings
- `_uswds-theme-components.scss` — component settings
- `_uswds-theme-general.scss` — general settings
- `_uswds-theme-spacing.scss` — spacing settings
- `_uswds-theme-typography.scss` — typography settings
- `_uswds-theme-utilities.scss` — utility class output settings

Because `uswds.paths.dist.theme` will be updated as the Design System updates, we recommend copying these files into an "overrides" (or similarly titled) folder and customizing them there.

The [USWDS Settings page]({{ site.baseurl }}/documentation/settings/) describes each of the settings available in the settings files, as well as the values the settings accept. Most settings accept design tokens, visit the [Design tokens section]({{ site.baseurl }}/design-tokens/) of our website for more information on the available tokens for [color]({{ site.baseurl }}/design-tokens/color), [spacing units]({{ site.baseurl }}/design-tokens/spacing-units), [font size]({{ site.baseurl }}/design-tokens/typesetting/font-size/), and more.

You can also use `uswds-gulp` to watch for any changes to your project Sass and recompile the CSS. Watch and recompile with the following command:
You can also use `uswds-compile` to watch for any changes to your project Sass and recompile the CSS. Watch and recompile with the following command:

{:.site-terminal}
```bash
Expand All @@ -31,6 +33,6 @@ npx gulp watch

This command will run in your Terminal window. When you want to shut it down, use `control-c`.

Our showcase illustrates how other teams of developers and designers have taken the building blocks USWDS provides and redesigned them for their brand and message.
Our [showcase](https://designsystem.digital.gov/getting-started/showcase/all/) illustrates how other teams of developers and designers have taken the building blocks the Design System provides and redesigned them for their brand and message. We hope the possibilities inspire your team!

We’re looking forward to hearing about your experience and seeing how USWDS's components look in your project!