You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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]>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+43-7Lines changed: 43 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -9,12 +9,6 @@ Please take a look at our [Code of Conduct](CODE_OF_CONDUCT.md) to learn more.
9
9
10
10
If you are interested in running this site locally, please take a look at [setting up your local development environment](/README.md#running-locally).
11
11
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
-
18
12
## Submitting a pull request
19
13
20
14
-[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
23
17
24
18
**Note:** more information on the [GitHub flow](https://guides.github.com/introduction/flow/)
25
19
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:
| 👍 `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
+
26
63
## Proposing new patterns
27
64
28
65
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:
29
66
30
67

31
-
32
68
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.
33
69
34
70
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).
Copy file name to clipboardExpand all lines: LICENSE.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,10 @@ The Open Sans font files are from [Google Web Fonts](https://fonts.google.com/sp
8
8
9
9
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"
10
10
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).
12
12
13
13
### Files licensed under the MIT license
14
14
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.
- 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
78
77
-`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
79
80
-`yarn lint`
80
-
- Runs just the linting portion of the tests
81
+
- Runs just the linting portion of the tests, eslint and stylelint
81
82
-`yarn release`
82
83
- Bumps package versions and tags a release commit. Read our [Release Process guide](/guides/RELEASE-PROCESS.md) for more info.
83
84
84
85
### Visual regression testing
85
86
86
87
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.
87
88
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.
89
90
90
91
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
93
93
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
94
94
2. If differences are detected and expected, run `yarn loki update`
0 commit comments