diff --git a/packages/govuk-frontend-review/src/views/component-preview.njk b/packages/govuk-frontend-review/src/views/component-preview.njk index 36ec621a39..4be66939d0 100644 --- a/packages/govuk-frontend-review/src/views/component-preview.njk +++ b/packages/govuk-frontend-review/src/views/component-preview.njk @@ -4,10 +4,6 @@ {% block pageTitle %}{{ templateTitle }} - GOV.UK Frontend{% endblock %} -{% set bodyClasses %} - {{ bodyClasses }} -{% endset %} - {# Remove standard template banners/headers/frontmatter #} {% block skipLink %}{% endblock %} {% block bodyStart %} {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/component.njk b/packages/govuk-frontend-review/src/views/component.njk index a853ab803c..a9aea3017b 100644 --- a/packages/govuk-frontend-review/src/views/component.njk +++ b/packages/govuk-frontend-review/src/views/component.njk @@ -5,9 +5,7 @@ {% block pageTitle %}{{ componentName | unslugify }} - GOV.UK Frontend{% endblock %} -{% set bodyClasses %} - language-markup -{% endset %} +{% set bodyClasses = "language-markup" %} {% set htmlMarkup %} {% include componentName + "/" + componentName + ".njk" ignore missing %} diff --git a/packages/govuk-frontend-review/src/views/components.njk b/packages/govuk-frontend-review/src/views/components.njk index ea1c6f906c..eabcb04d29 100644 --- a/packages/govuk-frontend-review/src/views/components.njk +++ b/packages/govuk-frontend-review/src/views/components.njk @@ -5,9 +5,7 @@ {% block pageTitle %}All components - GOV.UK Frontend{% endblock %} -{% set bodyClasses %} - language-markup -{% endset %} +{% set bodyClasses = "language-markup" %} {% block beforeContent %} {{ govukBreadcrumbs({ diff --git a/packages/govuk-frontend/src/govuk/components/accordion/template.njk b/packages/govuk-frontend/src/govuk/components/accordion/template.njk index 23e01f90a0..b7f85c46db 100644 --- a/packages/govuk-frontend/src/govuk/components/accordion/template.njk +++ b/packages/govuk-frontend/src/govuk/components/accordion/template.njk @@ -1,9 +1,9 @@ {% from "../../macros/i18n.njk" import govukI18nAttributes %} -{% set id = params.id %} -{% set headingLevel = params.headingLevel if params.headingLevel else 2 %} +{%- set id = params.id %} +{% set headingLevel = params.headingLevel if params.headingLevel else 2 -%} -
+ {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> {% for item in params.items %} {% if item %}
diff --git a/packages/govuk-frontend/src/govuk/components/back-link/template.njk b/packages/govuk-frontend/src/govuk/components/back-link/template.njk index 59c979369f..8b6b8bf230 100644 --- a/packages/govuk-frontend/src/govuk/components/back-link/template.njk +++ b/packages/govuk-frontend/src/govuk/components/back-link/template.njk @@ -1,2 +1,2 @@ -{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }} +{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }} diff --git a/packages/govuk-frontend/src/govuk/components/breadcrumbs/template.njk b/packages/govuk-frontend/src/govuk/components/breadcrumbs/template.njk index 13c8219165..48df23374f 100644 --- a/packages/govuk-frontend/src/govuk/components/breadcrumbs/template.njk +++ b/packages/govuk-frontend/src/govuk/components/breadcrumbs/template.njk @@ -9,12 +9,12 @@ {% set classNames = classNames + " govuk-breadcrumbs--collapse-on-mobile" %} {% endif -%} -
+
    {% for item in params.items %} {% if item.href %}
  1. - {{ item.html | safe if item.html else item.text }} + {{ item.html | safe if item.html else item.text }}
  2. {% else %}
  3. {{ item.html | safe if item.html else item.text }}
  4. diff --git a/packages/govuk-frontend/src/govuk/components/button/template.njk b/packages/govuk-frontend/src/govuk/components/button/template.njk index 41d4b75f23..3a258f4866 100644 --- a/packages/govuk-frontend/src/govuk/components/button/template.njk +++ b/packages/govuk-frontend/src/govuk/components/button/template.njk @@ -5,7 +5,7 @@ {% set classNames = classNames + " " + params.classes %} {% endif %} -{# Determine type of element to use, if not explicitly set #} +{#- Determine type of element to use, if not explicitly set #} {%- if params.element %} {% set element = params.element | lower %} {% else %} @@ -30,11 +30,11 @@ treat it as an interactive element - without this it will be {#- Define common attributes that we can use across all element types #} -{%- set commonAttributes %} class="{{ classNames }}" data-module="govuk-button"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% if params.id %} id="{{ params.id }}"{% endif %}{% endset %} +{%- set commonAttributes %} class="{{ classNames }}" data-module="govuk-button" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% if params.id %} id="{{ params.id }}"{% endif %}{% endset %} {#- Define common attributes we can use for both button and input types #} -{%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %}{% if params.disabled %} disabled aria-disabled="true"{% endif %}{% if params.preventDoubleClick !== undefined %} data-prevent-double-click="{{params.preventDoubleClick}}"{% endif %}{% endset %} +{%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %}{% if params.disabled %} disabled aria-disabled="true"{% endif %}{% if params.preventDoubleClick !== undefined %} data-prevent-double-click="{{ params.preventDoubleClick }}"{% endif %}{% endset %} {#- Actually create a button... or a link! #} diff --git a/packages/govuk-frontend/src/govuk/components/character-count/template.njk b/packages/govuk-frontend/src/govuk/components/character-count/template.njk index f621c289d9..4797e4b43d 100644 --- a/packages/govuk-frontend/src/govuk/components/character-count/template.njk +++ b/packages/govuk-frontend/src/govuk/components/character-count/template.njk @@ -1,15 +1,14 @@ {% from "../../macros/i18n.njk" import govukI18nAttributes %} - {% from "../textarea/macro.njk" import govukTextarea %} {% from "../hint/macro.njk" import govukHint %} -{%- set hasNoLimit = (not params.maxwords and not params.maxlength) %} +{%- set hasNoLimit = (not params.maxwords and not params.maxlength) -%}
    Country - +
    values: - british diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk b/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk index 5cc7edcc60..49ebb9bd23 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk @@ -1,4 +1,4 @@ -{% from "../error-message/macro.njk" import govukErrorMessage -%} +{% from "../error-message/macro.njk" import govukErrorMessage %} {% from "../fieldset/macro.njk" import govukFieldset %} {% from "../hint/macro.njk" import govukHint %} {% from "../label/macro.njk" import govukLabel %} @@ -43,8 +43,7 @@ }) | indent(2) | trim }} {% endif %}
    + {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-module="govuk-checkboxes"> {% for item in params.items %} {% if item %} {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#} @@ -75,7 +74,7 @@ {%- if item.conditional.html %} data-aria-controls="{{ conditionalId }}"{% endif -%} {%- if item.behaviour %} data-behaviour="{{ item.behaviour }}"{% endif -%} {%- if itemDescribedBy %} aria-describedby="{{ itemDescribedBy }}"{% endif -%} - {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}> + {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> {{ govukLabel({ html: item.html, text: item.text, @@ -94,7 +93,7 @@ {% endif %}
    {% if item.conditional.html %} -
    +
    {{ item.conditional.html | safe }}
    {% endif %} diff --git a/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml b/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml index ec1149e612..98d8433749 100644 --- a/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml +++ b/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml @@ -155,7 +155,9 @@ examples: options: messages: - headingHtml: Cookies on my service - html:

    We use cookies in our service.

    We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.

    + html: | +

    We use cookies in our service.

    +

    We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.

    actions: - text: Accept analytics cookies type: submit diff --git a/packages/govuk-frontend/src/govuk/components/cookie-banner/template.njk b/packages/govuk-frontend/src/govuk/components/cookie-banner/template.njk index f07d85c255..ced7332503 100644 --- a/packages/govuk-frontend/src/govuk/components/cookie-banner/template.njk +++ b/packages/govuk-frontend/src/govuk/components/cookie-banner/template.njk @@ -1,17 +1,12 @@ {% from "../button/macro.njk" import govukButton -%} -