Skip to content

paulwaitehomeoffice/govuk_elements

 
 

Repository files navigation

GOV.UK elements · JavaScript Style Guide Greenkeeper badge

GOV.UK elements is three things:

  1. An online design guide, explaining how to make your service look consistent with the rest of GOV.UK.
  2. An example of how to use the code in the GOV.UK template and the GOV.UK frontend toolkit.
  3. An npm package of the Sass files.

GOV.UK elements guide

http://govuk-elements.herokuapp.com/.

Using govuk-elements-sass

Installation and usage instructions can be found in the govuk-elements-sass README.

Running this site locally

If you would like to clone the repository and run it locally, you will need Node.js (at least version v0.10.0).

Clone this repository

git clone [email protected]:alphagov/govuk_elements.git

Install all dependencies

npm install

Run the app

npm start

Go to localhost:3000 in your browser.

Running tests

To check the whole codebase, run:

npm test

Linting

GOV.UK lint

GOV.UK elements uses govuk-lint, which uses scss-lint as its scss linter.

Standard JavaScript

GOV.UK elements uses standardjs, an opinionated JavaScript linter. All JavaScript files follow its conventions.

Both linters run on CI to ensure that new pull requests are in line with them.

Running Wraith to compare changes

GOV.UK elements uses Wraith so that regressions can be easily spotted.

This needs to be run from the Wraith directory /tests/wraith and some dependencies need to be installed on the local machine first.

  1. Install Wraith and its dependencies.

     gem install wraith
     
     brew install phantomjs
     
     brew install imagemagick
    
  2. Take a baseline of the current version.

On master run:

    wraith history config.yaml
  1. Switch to your feature branch and make changes.

On your feature branch run:

    wraith latest config.yaml

Releasing a new version

Follow the instructions in CONTRIBUTING.md.

Pattern libraries using GOV.UK elements

Here are examples of service-specific pattern libraries using GOV.UK elements.

Contributing

You can find contribution guidelines in CONTRIBUTING.md

About

GOV.UK Elements form the building blocks from which all pages are made.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 58.7%
  • CSS 28.2%
  • JavaScript 11.9%
  • Other 1.2%