GithubHelp home page GithubHelp logo

hmrc-frontend's Introduction

HMRC Frontend

HMRC Frontend contains the code and documentation for patterns specifically designed for HMRC.

GOV.UK Frontend and the GOV.UK Design System contains the code and documentation for design patterns designed to be used by all government departments.

The two sets of code and documentation are separate but used together.

See HMRC Design Patterns for examples of what the design patterns look like and guidance on how to use them in your service.

Quick Start

Requirements

To install more than one version of Node.js, it may be easier to use a node version manager like nvm or n.

How to install

Clone this repository and install its dependencies.

git clone https://github.com/hmrc/hmrc-frontend.git
cd hmrc-frontend
npm install

How to run

  1. Run npm start
  2. Components are available at http://localhost:3000

Using HMRC Frontend locally

Prototypes

npm install hmrc-frontend

Frontend microservices

We offer a few ways of incorporating the GOV UK and HMRC CSS and JS libraries into your service. Pick the one which best suits your service. In the following instructions, 1.X.X and 3.X.X refers to the version of the library you require.

1. CDN

If you are just using the GOVUK Frontend and HMRC Frontend and are not going to be adding any service-specific CSS or JS we suggest you use the HMRC CDN version of the assets. You will need to link to these in your service’s page template.

  1. add CDN js links to your @bodyEnd block in the layout template
    • <script type="text/javascript" src="https://www.tax.service.gov.uk/assets/hmrc-frontend/1.X.X/hmrc-frontend-1.X.X.min.js"></script>
  2. add CDN css links to your @headTag block in the layout template
    • <link rel="stylesheet" type="text/css" href="https://www.tax.service.gov.uk/assets/hmrc-frontend/1.X.X/hmrc-frontend-1.X.X.min.css">
    • <link rel="stylesheet" type="text/css" href="https://www.tax.service.gov.uk/assets/hmrc-frontend/1.X.X/hmrc-frontend-ie8-1.X.X.min.css"> `

2. Webjar

If you are adding some custom CSS to your service we suggest you use a webjar to pull in the GOV UK and HMRC Frontend libraries. This will enable you to use the appropriate SASS mixins to ensure your custom code is consistent with other components. It will allow you to package your code along with the libraries into a single download for the user. It will also mean you can optionally just consume the parts of the libraries you actually need for your service.

  1. add "org.webjars.npm" % "govuk-frontend" % "3.X.X" to your app dependencies (hmrc-frontend has a dependency on govuk-frontend)
  2. add "org.webjars.npm" % "hmrc-frontend" % "1.X.X" to your app dependencies
  3. in application.scss:
    • add $hmrc-assets-path: "/url-of-your-service/assets/lib/hmrc-frontend/hmrc/";
    • to import all components, add @import "lib/hmrc-frontend/hmrc/all";
    • to import individual components, add
      • @import "lib/hmrc-frontend/hmrc/components/header/header";
      • @import "lib/hmrc-frontend/hmrc/components/account-menu/account-menu";
      • and so on
    • to add to or override SASS, update application.scss or create additional .scss files and import them as described above
  4. in application.js:
    • to add to or override javascript, update application.js or create additional .js files and add them to build.sbt

How to contribute

Design patterns

If you need a pattern that does not appear in the HMRC Design Patterns, you can contribute a new one.

Features and issues

If you would like to propose a feature or raise an issue with HMRC Frontend, create an issue.

You can also create a pull request to contribute to HMRC Frontend. See our contribution process and guidelines for HMRC Frontend before you create a pull request.

License

This code is open source software licensed under the Apache 2.0 License.

hmrc-frontend's People

Contributors

dabd avatar gordonmcmullan avatar hmrc-web-operations avatar ian-leggett avatar jennifer-hodgson avatar luatec avatar matthewmascord avatar nataliecarey avatar rpowis avatar silasl avatar timsb avatar tomasz-rosiek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.