Skip to content

Commit a0b6138

Browse files
committed
Update install page
1 parent f2111b0 commit a0b6138

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

source/installing-with-npm/index.html.md.erb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ weight: 10
1111

1212
GOV.UK Frontend requires Node.js version 12.17.0 or later to support ECMAScript (ES) modules. Where possible, we recommend you install the latest Long Term Support (LTS) version.
1313

14-
2. `cd` to the root of your project and check if you have a [`package.json` file](https://docs.npmjs.com/files/package.json). If you do not have the file, create it by running:
14+
2. `cd` to the root of your project and check if you have a [package.json file](https://docs.npmjs.com/cli/v11/configuring-npm/package-json). If you do not have the file, create it by running:
1515

1616
```
1717
npm init
1818
```
1919

2020
3. Install [Dart Sass](https://www.npmjs.com/package/sass) - version 1.79.0 or higher.
2121

22-
You might see deprecation warnings when compiling your Sass. If required, you can [silence deprecation warnings caused by dependencies](../include-css/#silence-deprecation-warnings-from-dependencies-in-dart-sass).
22+
You might see deprecation warnings when compiling your Sass. If required, you can [silence deprecation warnings caused by dependencies](/include-css/#silence-deprecation-warnings-from-dependencies-in-dart-sass).
2323

24-
Do not use either LibSass or Ruby Sass as they are no longer supported by the Sass developers or GOV.UK Frontend. Projects using these compilers should [migrate to Dart Sass](https://sass-lang.com/blog/libsass-is-deprecated#how-do-i-migrate) as soon as possible.
24+
Do not use either LibSass or Ruby Sass as they are no longer supported by the Sass developers or GOV.UK Frontend. Projects using these compilers should [migrate to Dart Sass](https://sass-lang.com/blog/libsass-is-deprecated/#how-do-i-migrate) before updating to GOV.UK Frontend v6.0.
2525

26-
You can also [install Nunjucks v3.0.0 or later](https://www.npmjs.com/package/nunjucks) if you want to [use GOV.UK Frontend's Nunjucks macros](../use-nunjucks/).
26+
You can also [install Nunjucks v3.0.0 or later](https://www.npmjs.com/package/nunjucks) if you want to [use GOV.UK Frontends Nunjucks macros](/use-nunjucks/).
2727

2828
## Install GOV.UK Frontend
2929

@@ -35,21 +35,21 @@ npm install govuk-frontend --save
3535

3636
When the installation finishes, the `govuk-frontend` package will be in your `node_modules` folder.
3737

38-
## Get the CSS, Assets and JavaScript working
38+
## Add HTML for a component
3939

40-
Add the HTML for a component to your application. We recommend the accordion component as this makes it easier to spot if JavaScript is not working.
40+
Add the HTML for a component to your application. We recommend the accordion component as this makes it easy to spot if JavaScript is not working.
4141

4242
Go to the [example accordion component](https://design-system.service.gov.uk/components/accordion/#accordion-example) on the GOV.UK Design System website, then copy the HTML.
4343

4444
Paste the HTML into a page or template in your application.
4545

46-
### Get the CSS working
46+
## Get the CSS working
4747

4848
1. Copy the `/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css` file into your application.
4949

5050
2. Add your CSS file to your page layout if you need to. For example:
5151

52-
```html
52+
```scss
5353
<head>
5454
<!-- // ... -->
5555
<link rel="stylesheet" href="<YOUR-STYLESHEETS-FOLDER>/govuk-frontend.min.css">
@@ -61,33 +61,33 @@ Paste the HTML into a page or template in your application.
6161

6262
The accordion will use a generic font until you get the font and images working, and will not be interactive until you get the JavaScript working.
6363

64-
There are also different ways you can [import GOV.UK Frontend's CSS](../include-css/), including into your project's main Sass file:
64+
There are also different ways you can [include GOV.UK Frontends CSS](/include-css/), including into your projects main Sass file:
6565

6666
```scss
67-
@import "node_modules/govuk-frontend/dist/govuk";
67+
@use "node_modules/govuk-frontend/dist/govuk" as *;
6868
```
6969

70-
### Get the font and images working
70+
## Get the font and images working
7171

72-
Your component will not use the right font or images until you've added GOV.UK Frontend's assets to your application.
72+
Your component will not use the correct font or images until youve added GOV.UK Frontends assets to your application.
7373

7474
1. Copy the following 3 items:
75+
7576
- `/node_modules/govuk-frontend/dist/govuk/assets/images` folder to `<YOUR-APP>/assets/images`
7677
- `/node_modules/govuk-frontend/dist/govuk/assets/fonts` folder to `<YOUR-APP>/assets/fonts`
7778
- `/node_modules/govuk-frontend/dist/govuk/assets/manifest.json` file to `<YOUR-APP>/assets`
7879

79-
2. Run your application, then use [the Fonts tab in Firefox Page Inspector](https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts#The_Fonts_tab) to check the accordion is using the GDS Transport font.
80+
2. Run your application, then use [the Fonts tab in Firefox Page Inspector](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/edit_fonts/index.html#The_Fonts_tab) to check the accordion is using the GDS Transport font.
8081

81-
In your live application, we recommend [using an automated task or your build pipeline](../import-font-and-images-assets/) instead of copying the files manually.
82+
You can also [configure how GOV.UK Frontend locates its font and image assets](/import-font-and-images-assets/) to suit your application architecture.
8283

83-
### Get the JavaScript working
84+
## Get the JavaScript working
8485

8586
1. Add the following to the top of the `<body class="govuk-template__body">` section of your page template:
8687

87-
```html
88+
```scss
8889
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
8990
```
90-
9191
2. Copy the `/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js` file into your application.
9292

9393
3. Import the file before the closing `</body>` tag of your page template, then run the `initAll` function to initialise all the components. For example:
@@ -107,9 +107,9 @@ In your live application, we recommend [using an automated task or your build pi
107107

108108
In your live application, we recommend:
109109

110-
- [using an automated task or your build pipeline](../import-javascript/) instead of copying the files manually
111-
- importing only the components your application uses and [using `createAll` to initialise](../import-javascript/#import-individual-components) all their instances on the page
110+
- [using an automated task or your build pipeline](https://frontend.design-system.service.gov.uk/import-javascript/) instead of copying the files manually
111+
- importing only the components your application uses and [using createAll to initialise](/import-javascript/#import-individual-components) all their instances on the page
112112

113113
Make sure you import all the components used throughout your application or some components will not work correctly for disabled users who use assistive technologies.
114114

115-
Once your testing is complete you can use the full code for page layouts and other components from the [Design System website](https://design-system.service.gov.uk/).
115+
Once your testing is complete, you can use the full code for page layouts and other components from the [Design System website](https://design-system.service.gov.uk/).

0 commit comments

Comments
 (0)