Make remove ('x') links buttons

The text never had underlines like our other
link-button components so always looked like
buttons. If they look like buttons, they should
act like them too and have those semantics.

This give them a role of button and uses the class
and data attribute for the button component from
GOVUK Frontend to make them work like one.

These changes include a fair amount of styles to
override those the govuk-button class brings in.
I've tried to mark those ones to at least make
that obvious.
This commit is contained in:
Tom Byers
2021-10-22 11:54:41 +01:00
parent 9d59edb3ce
commit c34fd4de6e
2 changed files with 31 additions and 24 deletions

View File

@@ -31,7 +31,7 @@
{% endif %}
<li class="area-list-item">
{{ area.name }}
<a class="area-list-item-remove" href="{{ url_for('.remove_broadcast_area', service_id=current_service.id, broadcast_message_id=broadcast_message.id, area_slug=area.id) }}">
<a class="area-list-item-remove govuk-button" data-module="govuk-button" role="button" href="{{ url_for('.remove_broadcast_area', service_id=current_service.id, broadcast_message_id=broadcast_message.id, area_slug=area.id) }}">
<svg id="area-list-item-remove__icon" width="12" height="12" viewbox="0 0 12 12" aria-labelledby="area__{{ loop.index }}" role="img" xmlns="http://www.w3.org/2000/svg"> <g>
<title id="area__{{ loop.index }}">Remove {{ area.name }}</title>
<g transform="rotate(45),translate(1, -7.5)">