You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Copy the font and image files into your application
25
25
26
-
If you decide to copy the assets instead, copy the:
26
+
If you decide to copy the assets instead, copy these 3 items:
27
27
28
28
- `/node_modules/govuk-frontend/dist/govuk/assets/images` folder to `<YOUR-APP>/assets/images`
29
29
- `/node_modules/govuk-frontend/dist/govuk/assets/fonts` folder to `<YOUR-APP>/assets/fonts`
@@ -33,24 +33,23 @@ You should use an automated task or your build pipeline to copy the files, so yo
33
33
34
34
### If you have your own folder structure
35
35
36
-
If you use a different folder structure than `<YOUR-APP>/assets/images` and `<YOUR-APP>/assets/fonts`, you can set Sass variables so that Sass builds the CSS to point to your folders.
36
+
If you use a different folder structure than `<YOUR-APP>/assets/images` and `<YOUR-APP>/assets/fonts`, you can [configure GOV.UK Frontend](/include-css/#configure-gov-uk-frontend) so that Sass builds the CSS according to your folder structure.
37
37
38
-
Set one of the following before the `@import` line in your Sass file:
39
-
40
-
- `$govuk-assets-path`
41
-
- `$govuk-images-path` and `$govuk-fonts-path`
42
-
43
-
Set the `$govuk-assets-path` variable if your `font` and `image` folders have the same parent folder. For example:
38
+
Configure the [`$govuk-assets-path`](/sass-api-reference/#govuk-assets-path) variable if your `font` and `image` folders have the same parent folder. For example:
44
39
45
40
```scss
46
-
$govuk-assets-path: "/<YOUR-ASSETS-FOLDER>/";
41
+
@use "node_modules/govuk-frontend/dist/govuk" as * with (
42
+
$govuk-assets-path: "/<YOUR-ASSETS-FOLDER>/"
43
+
);
47
44
```
48
45
49
-
Set the `$govuk-images-path` and `$govuk-fonts-path` variables if your `font` and `image` folders have different parent folders. For example:
46
+
Configure the [`$govuk-images-path`](/sass-api-reference/#govuk-images-path) and [`$govuk-fonts-path`](/sass-api-reference/#govuk-fonts-path) variables if your `font` and `image` folders have different parent folders. For example:
50
47
51
48
```scss
52
-
$govuk-images-path: "/<YOUR-IMAGES-FOLDER>/";
53
-
$govuk-fonts-path: "/<YOUR-FONTS-FOLDER>/";
49
+
@use "node_modules/govuk-frontend/dist/govuk" as * with (
50
+
$govuk-images-path: "/<YOUR-IMAGES-FOLDER>/",
51
+
$govuk-fonts-path: "/<YOUR-FONTS-FOLDER>/"
52
+
);
54
53
```
55
54
56
-
You can also use your own function to generate paths, for example if you're using `asset-pipeline` in [sass-rails](https://github.com/rails/sass-rails). Set the `$govuk-image-url-function` and `$govuk-font-url-function` variables to the name of your function.
55
+
You can also use your own function to generate paths, for example if you’re using `asset-pipeline` in [sass-rails](https://github.com/rails/sass-rails). Configure the [`$govuk-image-url-function`](/sass-api-reference/#govuk-image-url-function) and [$govuk-font-url-function](/sass-api-reference/#govuk-font-url-function) variables with the function you need to use.
0 commit comments