This project repo is no longer being maintained.
Style for code.gov including buttons, banners, and cards. Inspired by and somewhat based on USWDS.
All style components are viewable online.
As our code base expands, maintaining and remembering all the CSS class names has become difficult. The code.gov Style Guide makes the search and usage of CSS classes easier by providing examples of their usage. These styles are not meant for usage outside of code.gov. Feel free to fork this though if you want to create your own style guide :-)
Clone the code-gov-style repository locally. After cloning locally, follow these steps:
- In your terminal, run
npm installto install all dependencies - In your terminal, run
bundle installto add all ruby gems- (Note - your Bundler version should be >1.17.3. To install Bundler, run
gem install bundlerfrom your terminal)
- (Note - your Bundler version should be >1.17.3. To install Bundler, run
- To serve the Code.gov Style Guide locally, in your terminal, run
npm run-script serve- This should output what the server address is on your local machine.
This package is meant to be used with the code-gov-front-end project. Please follow the configuration settings for the project.
You may want to view your style changes in the code-gov-style repo on your local machine for testing. Follow these steps to do so:
- Clone the latest version of the
code-gov-stylerepository. - Run
npm installto install the dependencies required for the package in thecode-gov-styledirectory. - Run
npm linkin the root level of thecode-gov-styledirectory on your local machine. - On the
code-gov-front-endproject, clone the repository and runnpm installif you haven’t done this already. - Run
npm link @code.gov/code-gov-stylein the root level of the code-gov-front-end directory on your local machine.
You are now using the latest version of the code.gov design system via your cloned version when running the code-gov-front-end site on your local machine. To stop using this version, run npm unlink @code.gov/code-gov-style from the root level of the code-gov-front-end directory.
Our continuous integration pipeline runs linting and accessibility tests on every pull request. Be sure to test your code by doing the following:
-
Use the
npm run lintcommand to lint your.scssfiles. -
To run web accessibility testing do the following: a. Make sure ruby and the bundler gem are installed on your computer. b. Start a server by running
npm run serve. c. Use thenpm run test-pa11ycommand to run the accessibility test.
The accessibility testing configuration is located in the .pa11yci file. We follow the WCAG2AA standard. For more info on the rules being tested checkout the pa11y wiki
The https://gsa.github.io/code-gov-style/ site is built using GitHub pages from the master branch. Any merges to the master branch will update the site within a few minutes.
In order for any style guide changes to be reflected on the code-gov-front-end, they must be deplyed to NPM and the package version that code-gov-front-end uses needs to be incremented.
We use the fa-search icon from Font Awesome. Font Awesome released their fa-search icon under this license https://creativecommons.org/licenses/by/4.0/
We copy-pasted some code from the hamburgers library to _hamburgers.scss. Hamburgers was created by Jonsuh. Hamburgers is released under the MIT License and can be found here https://github.com/jonsuh/hamburgers/blob/master/LICENSE as well as in the licenses folder in this repository.
Have a question? Check out our FAQS. If it's not there, feel free to post an issue or email us :-)
Twitter: @CodeDotGov
Email: code@gsa.gov
LinkedIn: code-gov
Join our #opensource-public Slack channel: https://chat.18f.gov/