Skip to content

Commit 5347f7a

Browse files
Forrest Baerpwolfert
andauthored
NO-TICKET Guide/Core doc cleanup (#1722)
* removing all guides * updates to core docs to reflect recent changes with loki and guide removal * 'adding guiding principles to contributing' * Update CONTRIBUTING.md Co-authored-by: Patrick Wolfert <[email protected]> * updating governance, moving to root Co-authored-by: Patrick Wolfert <[email protected]>
1 parent 4dd7c06 commit 5347f7a

10 files changed

+51
-531
lines changed

CONTRIBUTING.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ Please take a look at our [Code of Conduct](CODE_OF_CONDUCT.md) to learn more.
99

1010
If you are interested in running this site locally, please take a look at [setting up your local development environment](/README.md#running-locally).
1111

12-
Use [our guides](https://github.com/CMSgov/design-system/tree/master/guides) to find additional information like:
13-
14-
- Guiding principles
15-
- Coding guidelines
16-
- How to write documentation
17-
1812
## Submitting a pull request
1913

2014
- [Fork the design system](https://guides.github.com/activities/forking/) into your GitHub account
@@ -23,12 +17,54 @@ Use [our guides](https://github.com/CMSgov/design-system/tree/master/guides) to
2317

2418
**Note:** more information on the [GitHub flow](https://guides.github.com/introduction/flow/)
2519

20+
## Guiding development principles
21+
22+
As we're building the design system it helps to have some guiding principles in place to refer back to when we reach forks in the road. Forks in the road can be the different ways something could be named, whether a certain component belongs in the design system, etc. These guiding principles aren't set in stone and should evolve as opinions are evolved.
23+
24+
_If you'd like to provide feedback on these principles, please [open a GitHub issue for discussion](https://github.com/CMSgov/design-system/issues/new)._
25+
26+
### Compatible with existing codebases
27+
28+
A developer should be able to import the design system into an existing codebase without causing unintended visual changes. Implementing the design system should be a deliberate process and developers should be able to incrementally add the design system to an existing site.
29+
30+
For example, the design system avoids styling base HTML elements (`body`, `h1`) because an existing codebase likely already has CSS rulesets for those elements and we can't predict the intentions of those rulesets. Our solution then is to only use namespaced class selectors (`.ds-base`, `.ds-h1`, `.ds-c-button`) which allows a developer to choose where the design system's styles are applied.
31+
32+
### Favor clarity over succinctness
33+
34+
The design system should favor clarity over succinctness. This means the design system may be verbose, but it should deliver clarity and resilience in exchange. Keeping CSS legible and scalable, and reducing cognitive load, means sacrificing a shorter syntax.
35+
36+
Some other design systems user abstract and condensed naming conventions (ie. "`mr1`"). However, this naming convention can be intimidating, difficult to understand at a glance, has a steep learning curve, and results in a lot of back and forth between project code and the system's documentation.
37+
38+
Here are a few examples of how the design system favors clarity over succinctness with its CSS class names:
39+
40+
| Design system (Good) | Abstract names (Bad) | Description |
41+
| ------------------------- | -------------------- | --------------------------------------------------------------- |
42+
| 👍 `ds-u-margin-right--1` | 🙅 `mr1` | A utility class, applies a right margin that is 1x the baseline |
43+
| 👍 `ds-c-button` | 🙅 `btn` | A button component |
44+
45+
### Favor generalized names
46+
47+
Avoid naming that indicates a specific use-case or styling, e.g. `snippet` rather than `search-snippet`.
48+
49+
The names and phrasing of the design system's parts should also still make sense when a different theme is applied, e.g. `primary` rather than `blue`.
50+
51+
### Variations exist only when they can't be achieved with a utility class
52+
53+
The design system includes utility classes for modifying the most common visual traits, like spacing, size, and color. You may want to offer variations of a component that involves changing one of these traits. When you do, you should first see if users of the design can accomplish the variation by applying one of the utility classes to your component.
54+
55+
This accomplishes a few things: Most importantly it reduces the total amount of CSS, and secondly it teaches people how to use the utility classes.
56+
57+
### Support improvisation, but steer direction.
58+
59+
The design system should be opinionated about the visual design, accessibility, and voice, but it should also provide the tools and necessary parts for developers and designers to create components and more complex patterns that are unique to their project.
60+
61+
What does this mean in practice? One example is: Utility classes allow new ideas and patterns to form, while the components and base styling establish a voice and visual direction.
62+
2663
## Proposing new patterns
2764

2865
When considering what to do with a proposed pattern, there are several questions to answer first. The decision tree below outlines those questions to be answered and the various outcomes:
2966

3067
![CMS Design System component decision workflow](https://raw.githubusercontent.com/CMSgov/design-system/master/.github/images/CMS-Design-System-component-decision-workflow.jpg)
31-
3268
When a new pattern is created, it’s worth asking if it's a one-off use case or something that can be used on other sites. New patterns come at a cost in terms of additional code, maintenance, documentation, and increased cognitive load on users. Care should therefore be taken when adding patterns to the design system.
3369

3470
Our pattern proposal process is largely based on those by the [US Web Design System](https://github.com/uswds/uswds/wiki/Contribution-Guidelines%3A-Design).

GOVERNANCE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
See our governance process in Confluence
2+
https://confluence.cms.gov/x/LYWbGQ

LICENSE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ The Open Sans font files are from [Google Web Fonts](https://fonts.google.com/sp
88

99
The Bitter font files are from [Google Web Fonts](https://fonts.google.com/specimen/Bitter), licensed under the [SIL Open Font License](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL), and copyright [Sol Matas](www.huertatipografica.com.ar), with Reserved Font Name "Bitter"
1010

11-
The icons in `core/src/images` are from [Font Awesome](http://fontawesome.io/) by Dave Gandy under the [SIL Open Font License 1.1](http://scripts.sil.org/OFL).
11+
Svg icons are from [Font Awesome](http://fontawesome.io/) by Dave Gandy under the [SIL Open Font License 1.1](http://scripts.sil.org/OFL).
1212

1313
### Files licensed under the MIT license
1414

15-
- [Bourbon](http://bourbon.io/), copyright [thoughtbot](https://thoughtbot.com/), inc., under the [MIT license](https://github.com/thoughtbot/neat/blob/master/LICENSE.md).
16-
- [kss-node](https://github.com/kss-node/kss-node), copyright Hugh Kennedy, John Albin Wilkins, et. al.
1715
- [ev-emitter](https://github.com/metafizzy/ev-emitter)
1816

1917
#### Full license text for the MIT licensed files:

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,22 @@ These scripts can all be run from the root level of the repo:
7474
- Updates [Jest snapshots](http://facebook.github.io/jest/docs/en/snapshot-testing.html)
7575
- `yarn loki test`
7676
- Runs visual regression tests using [loki](https://storybook.js.org/addons/loki). See [Visual regression testing](#visual-regression-testing) section below for details.
77-
- Must be running Storybook simultaneously to use this command in development
7877
- `yarn loki update` updates reference screenshots used for visual regression testing. Update these only when we expect the visual changes
78+
- `yarn loki:healthcare test` to run the Healthcare.gov visual regression tests
79+
- `yarn loki:medicare test` to run the Medicare.gov visual regression tests
7980
- `yarn lint`
80-
- Runs just the linting portion of the tests
81+
- Runs just the linting portion of the tests, eslint and stylelint
8182
- `yarn release`
8283
- Bumps package versions and tags a release commit. Read our [Release Process guide](/guides/RELEASE-PROCESS.md) for more info.
8384

8485
### Visual regression testing
8586

8687
We use [loki](https://storybook.js.org/addons/loki) to test our components for visual regressions. It uses our existing Storybook stories, taking screenshots of them within a docker container and comparing those screenshots with ones previously taken and committed to version control.
8788

88-
Running loki tests locally require two things: you must be signed into Docker and you must have an instance of Storybook running locally.
89+
Running loki tests locally requires that you be signed into Docker.
8990

9091
1. Open the Docker app, and make sure you're signed in (Docker Desktop requires a license now)
91-
2. In your terminal window, start Storybook by running `yarn storybook`
92-
3. In another terminal window, run `yarn loki test` to begin comparing component images
92+
2. Run `yarn loki test` to begin comparing component images
9393
1. If differences are detected and unexpected, evaluate your changes - we only want to update and commit references when we expect the visual changes detected
9494
2. If differences are detected and expected, run `yarn loki update`
9595

guides/CODING-GUIDELINES.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

guides/FAQ.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

guides/GOVERNANCE.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

guides/GUIDING-PRINCIPLES.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)