Skip to content

Commit 30efd60

Browse files
committed
Added button classes and markup.
1 parent a5ef369 commit 30efd60

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Resources/views/Form/accessible-forms.html.twig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
</div>
131131
{% endblock checkbox_row %}
132132

133-
{# Checkbox / Radio buttons #}
133+
{# Add custom markup to checkbox / radio buttons in choice context #}
134134
{%- block choice_widget_expanded -%}
135135
<div {{ block('widget_container_attributes') }}>
136136
<div class="{% if multiple %}tbxforms-checkboxes{% else %}govuk-radios{% endif %}">
@@ -168,3 +168,15 @@
168168
{% set attr = attr|merge({'class': 'tbxforms-select'}) %}
169169
{{- parent() -}}
170170
{%- endblock choice_widget_collapsed -%}
171+
172+
{# Add class and SVG to buttons #}
173+
{%- block button_widget -%}
174+
{% set attr = attr|merge({'class': 'rnib-button rnib-button--primary'}) %}
175+
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>
176+
{{- block('form_label_content') -}}
177+
<svg viewBox="0 0 8 16" class="icon icon--chevron rnib-button__icon" aria-hidden="true" focusable="false">
178+
<path d="M3.692 0H0l4.308 8L0 16h3.692L8 8 3.692 0Z" fill="currentColor"></path>
179+
</svg>
180+
</button>
181+
{%- endblock button_widget -%}
182+

0 commit comments

Comments
 (0)