Skip to content

Commit

Permalink
Allow character count components to be decorated
Browse files Browse the repository at this point in the history
The character count is essentially a textarea and takes the same parameters for its input field.
  • Loading branch information
fofr committed Jul 29, 2022
1 parent a4cf48a commit 6d68716
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ You can then import the component macros as you would those provided by GOV.UK F
{% raw %}
- {% from "govuk/components/button/macro.njk" import govukButton %}
+ {% from "x-govuk/components/decorated/button/macro.njk" import govukButton with context %}
- {% from "govuk/components/character-count/macro.njk" import govukCharacterCount %}
+ {% from "x-govuk/components/decorated/character-count/macro.njk" import govukCharacterCount with context %}
- {% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
+ {% from "x-govuk/components/decorated/checkboxes/macro.njk" import govukCheckboxes with context %}
- {% from "govuk/components/date-input/macro.njk" import govukDateInput %}
Expand Down
4 changes: 4 additions & 0 deletions x-govuk/components/decorated/character-count/macro.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% from "govuk/components/character-count/macro.njk" import govukCharacterCount as source -%}
{%- macro govukCharacterCount(params) -%}
{{- source(decorate(params, params.decorate)) -}}
{%- endmacro %}

0 comments on commit 6d68716

Please sign in to comment.