Skip to content

Commit

Permalink
Update header to look like GOV.UK
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldfallen committed Aug 14, 2017
1 parent 7a8a42f commit 4088264
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
4 changes: 2 additions & 2 deletions examples/test-app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ lookAndFeel.configure(app, {
webpack: { entry: [path.resolve(__dirname, './assets/scss/main.scss')] }
});

app.get('/hello-world', (req, res) => {
res.render('HelloWorld');
app.get('/typography', (req, res) => {
res.render('Typography');
});

app.listen(config.port);
16 changes: 0 additions & 16 deletions examples/test-app/views/HelloWorld.html

This file was deleted.

16 changes: 16 additions & 0 deletions examples/test-app/views/Typography.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "layouts/two_thirds.html" %}
{% from "components/header.njk" import header %}
{% from "components/examples.njk" import example %}

{% block head -%}
<link href="{{ asset_path }}main.css" media="screen" rel="stylesheet" />
{% endblock %}

{% block two_thirds -%}
{{ header("Typography", "Components") }}

{{ header(heading="A 48px Bold heading", section="Section marker") }}
{{ header(heading="A 36px Bold heading", section="Section marker", size="large") }}
{{ header(heading="A 24px Bold heading", section="Section marker", size="medium") }}
{{ header(heading="A 19px Bold heading", section="Section marker", size="small") }}
{%- endblock %}
19 changes: 19 additions & 0 deletions templates/components/header.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{#
Header
heading - (required) Main heading text
section - (optional) Section text displayed above the heading
size - (default = 'xlarge') heading size
When size is not xlarge or large the section will not be displayed as
the size and lightness of the text would not be easily read.
#}
{% macro header(heading, section='', size='xlarge') %}
<h1 class="heading-{{ size }}">
{% if section != '' and (size == 'xlarge' or size == 'large') %}
<span class="heading-secondary">
{{ section }}
</span>
{% endif %}
{{ heading }}
</h1>
{% endmacro %}
9 changes: 0 additions & 9 deletions templates/patterns/header.njk

This file was deleted.

0 comments on commit 4088264

Please sign in to comment.