Skip to content

Commit

Permalink
Show examples using govuk-frontend.min.css
Browse files Browse the repository at this point in the history
We’re now using `govuk-frontend.min.css` from the GOV.UK Frontend package

Additionally, each preview uses a minimal `example.css` so the Design System website stylesheet is no longer neeeded
  • Loading branch information
colinrotherham committed Nov 1, 2023
1 parent aace7f4 commit 5335cf8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
5 changes: 5 additions & 0 deletions lib/metalsmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ module.exports = metalsmith
dest: 'assets'
}),

copyAssets('govuk-frontend.min.css?(.map)', {
cwd: dirname(require.resolve('govuk-frontend')),
dest: 'stylesheets'
}),

copyAssets('**/iframeResizer.contentWindow.@(map|min.js)', {
cwd: join(dirname(require.resolve('iframe-resizer')), 'js'),
dest: 'javascripts/vendor'
Expand Down
10 changes: 10 additions & 0 deletions src/stylesheets/example.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "example-init";

.app-example-page__wrapper {
overflow: auto;
background-color: govuk-colour("white");
}

.app-example-page {
padding: govuk-spacing(6);
}
9 changes: 0 additions & 9 deletions src/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@ $app-code-color: #d13118;
}
}

.app-example-page__wrapper {
overflow: auto;
background-color: govuk-colour("white");
}

.app-example-page {
padding: govuk-spacing(6);
}

// Copy button
.app-copy-button {
$copy-button-colour: #00823b;
Expand Down
5 changes: 3 additions & 2 deletions views/layouts/layout-example.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "govuk/template.njk" %}

{% set htmlClasses = 'app-example-page__wrapper' %}
{% set htmlClasses = "app-example-page__wrapper" %}
{% set assetUrl = 'https://design-system.service.gov.uk/assets' %}

{% block pageTitle %}{{ title | smartypants }} – Example – GOV.UK Design System{% endblock %}
Expand All @@ -12,7 +12,8 @@
<meta name="og:description" content="{{ description | smartypants }}">
<link rel="canonical" href="{{ canonical }}">

<link href="{{ getFingerprint('stylesheets/main.css') }}" rel="stylesheet" media="all">
<link href="{{ getFingerprint('stylesheets/govuk-frontend.min.css') }}" rel="stylesheet" media="all">
<link href="{{ getFingerprint('stylesheets/example.css') }}" rel="stylesheet" media="all">
{#- Include any additional stylesheets specified in the example frontmatter #}
{% for stylesheet in stylesheets %}
<link href="{{ getFingerprint(stylesheet) }}" rel="stylesheet" media="all">
Expand Down

0 comments on commit 5335cf8

Please sign in to comment.