Skip to content

Commit

Permalink
Merge pull request #2475 from alphagov/whitespace-input
Browse files Browse the repository at this point in the history
Tweak whitespace in input component HTML for improved readability
  • Loading branch information
Vanita Barrett authored Dec 22, 2021
2 parents df937b8 + a725c56 commit de237af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- [#2475: Tweak whitespace in input component HTML for improved readability](https://github.com/alphagov/govuk-frontend/pull/2475)

## 4.0.0 (Breaking release)

### Breaking changes
Expand Down
7 changes: 4 additions & 3 deletions src/govuk/components/input/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
}) | indent(2) | trim }}
{% endif %}

{%- if params.prefix or params.suffix %}<div class="govuk-input__wrapper">{% endif -%}
{%- if params.prefix or params.suffix %}<div class="govuk-input__wrapper">{% endif -%}

{%- if params.prefix.text or params.prefix.html %}
{%- if params.prefix.text or params.prefix.html -%}
<div class="govuk-input__prefix {{- ' ' + params.prefix.classes if params.prefix.classes }}" aria-hidden="true" {%- for attribute, value in params.prefix.attributes %} {{attribute}}="{{value}}"{% endfor %}>
{{- params.prefix.html | safe if params.prefix.html else params.prefix.text -}}
</div>
Expand All @@ -55,11 +55,12 @@
{%- if params.inputmode %} inputmode="{{ params.inputmode }}"{% endif %}
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>

{%- if params.suffix.text or params.suffix.html %}
{%- if params.suffix.text or params.suffix.html -%}
<div class="govuk-input__suffix {{- ' ' + params.suffix.classes if params.suffix.classes }}" aria-hidden="true" {%- for attribute, value in params.suffix.attributes %} {{attribute}}="{{value}}"{% endfor %}>
{{- params.suffix.html | safe if params.suffix.html else params.suffix.text -}}
</div>
{% endif -%}

{%- if params.prefix or params.suffix %}</div>{% endif %}

</div>

0 comments on commit de237af

Please sign in to comment.