-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #804 from alphagov/update-package-readme
Update readme in npm package
- v5.9.0
- v5.8.1-internal.1
- v5.8.0
- v5.7.1
- v5.7.0
- v5.6.0
- v5.5.0
- v5.4.1
- v5.4.0
- v5.3.1
- v5.3.0
- v5.2.0
- v5.1.0
- v5.0.0
- v5.0.0-internal.0
- v5.0.0-beta.2
- v5.0.0-beta.1
- v5.0.0-beta.0
- v4.9.0
- v4.8.0
- v4.7.0
- v4.6.0
- v4.5.0
- v4.4.1
- v4.4.0
- v4.3.1
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.1
- v4.0.0
- v3.15.0
- v3.14.0
- v3.13.1
- v3.13.0
- v3.12.0
- v3.11.0
- v3.10.2
- v3.10.1
- v3.10.0
- v3.9.1
- v3.9.0
- v3.8.1
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.0
- v2.13.0
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
Showing
4 changed files
with
76 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,96 @@ | ||
# GOV.UK Frontend - All components | ||
# GOV.UK Frontend | ||
|
||
All of the components in GOV.UK Frontend, in a single package. | ||
GOV.UK Frontend contains the code you need to start building a user interface | ||
for government platforms and services. | ||
|
||
## Guidance | ||
See live examples of GOV.UK Frontend components, and guidance on when to use | ||
them in your service, in the [GOV.UK Design System](https://www.gov.uk/design-system). | ||
|
||
Find out when to use the Back link component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital). | ||
## Contact the team | ||
|
||
## Dependencies | ||
GOV.UK Frontend is maintained by a team at Government Digital Service. If you want to know more about GOV.UK Frontend, please email the [Design System | ||
team](mailto:govuk-design-system-support@digital.cabinet-office.gov.uk) or get in touch with them on [Slack](https://ukgovernmentdigital.slack.com/messages/govuk-design-system). | ||
|
||
To consume all components you must be running npm version 5 or above. | ||
## Quick start | ||
|
||
## Installation | ||
There are 2 ways to start using GOV.UK Frontend in your app. | ||
|
||
npm install --save govuk-frontend | ||
Once installed, you will be able to use the code from the examples in the | ||
[GOV.UK Design System](https://www.gov.uk/design-system in your service. | ||
|
||
## Requirements | ||
### 1. Install with npm (recommended) | ||
|
||
### Build tool configuration | ||
We recommend [installing GOV.UK Frontend using node package manager | ||
(npm)](https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md). | ||
|
||
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp | ||
### 2. Install by using compiled files | ||
|
||
.pipe(sass({ | ||
includePaths: 'node_modules/' | ||
})) | ||
You can also [download the compiled and minified assets (CSS, JavaScript) from | ||
GitHub](https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-from-dist.md). | ||
|
||
### Static asset path configuration | ||
## Importing styles | ||
|
||
To show the button image you need to configure your app to show these assets. Below is a sample configuration using Express js: | ||
You need to import the GOV.UK Frontend styles into the main Sass file in your | ||
project. You should place the below code before your own Sass rules (or Sass | ||
imports) if you want to override GOV.UK Frontend with your own styles. | ||
|
||
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets'))) | ||
To import add the below to your Sass file: | ||
|
||
### Setting up Nunjucks views and paths | ||
```scss | ||
@import "node_modules/govuk-frontend/all"; | ||
``` | ||
|
||
Below is an example setup using express configure views: | ||
[More details on importing styles](https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md#importing-styles) | ||
|
||
nunjucks.configure('node_modules/govuk-frontend/components/', { | ||
autoescape: true, | ||
cache: false, | ||
express: app | ||
}) | ||
## Importing JavaScript | ||
|
||
Some of the JavaScript included in GOV.UK Frontend improves the usability and | ||
accessibility of the components. You should make sure that you are importing and | ||
initialising Javascript in your application to ensure that all users can use it successfully. | ||
|
||
You can include Javascript for all components either by copying the `all.js` from `node_modules/govuk-frontend` into your application or referencing the file directly: | ||
|
||
```html | ||
<script src="<path-to-govuk-frontend-all-file>/all.js"></script> | ||
``` | ||
Next you need to initialise the script by adding: | ||
|
||
```html | ||
<script>window.GOVUKFrontend.initAll()</script> | ||
``` | ||
|
||
[More details on importing Javascript and advanced options](https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md#importing-javascript) | ||
|
||
## Getting updates | ||
|
||
To check whether you have the latest version of the button run: | ||
## Importing assets | ||
|
||
In order to import GOV.UK Frontend images and fonts to your project, you should configure your application to reference or copy the relevant GOV.UK Frontend assets. | ||
|
||
[More details on importing assets](https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md#import-assets) | ||
|
||
|
||
## Getting updates | ||
|
||
npm outdated govuk-frontend | ||
To check whether you have the latest version of GOV.UK Frontend, run: | ||
|
||
To update the latest version run: | ||
``` | ||
npm outdated govuk-frontend | ||
``` | ||
|
||
npm update govuk-frontend | ||
To update to the latest version, run: | ||
|
||
``` | ||
npm update govuk-frontend | ||
``` | ||
|
||
## Contribution | ||
## Licence | ||
|
||
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository") | ||
Unless stated otherwise, the codebase is released under the MIT License. This | ||
covers both the codebase and any sample code in the documentation. The | ||
documentation is © Crown copyright and available under the terms of the | ||
Open Government 3.0 licence. | ||
|
||
## License | ||
## Contribution guidelines | ||
|
||
MIT | ||
If you want to help us build GOV.UK Frontend, view our [contribution | ||
guidelines](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md). |