Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak whitespace HTML for text input component to improve readability #2475

Merged
merged 2 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>