Skip to content

Commit

Permalink
Make GOV.UK Frontend assets paths work with http prefix
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Byford <[email protected]>
  • Loading branch information
lfdebrux and 36degrees committed Aug 17, 2022
1 parent d791c7b commit 1d45259
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/assets/stylesheets/_govuk_tech_docs.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
$govuk-assets-path: "/assets/govuk/assets/" !default;
// Set $govuk-assets-path so that $govuk-images-path and $govuk-fonts-path
// (used below, but set in govuk/base) are correct.
$govuk-assets-path: "/assets/govuk/assets/";

// Use Sprockets' asset url helpers to add the http prefix if present.
// GOV.UK Frontend provides hooks for us to define the url lookup functions,
// see https://frontend.design-system.service.gov.uk/sass-api-reference/
@function tech-docs-image-url-function($filename) {
@return image-url($govuk-images-path + $filename);
}

@function tech-docs-font-url-function($filename) {
@return font-url($govuk-fonts-path + $filename);
}

$govuk-font-url-function: "tech-docs-font-url-function";
$govuk-image-url-function: "tech-docs-image-url-function";

// Include only the bits of GOV.UK Frontend we need
$govuk-new-link-styles: true;
Expand Down

0 comments on commit 1d45259

Please sign in to comment.