Style cancel link and make it keyboard navigable

So that it looks and behaves like a normal link.
This commit is contained in:
Chris Hill-Scott
2018-12-05 16:29:04 +00:00
parent 5db1de3bbb
commit b0f89f7fe9
2 changed files with 21 additions and 1 deletions

View File

@@ -43,7 +43,9 @@
this.addCancelButton = function(state) {
let $cancel = $('<a></a>')
.html('Cancel')
.click((event) => {
.attr('class', 'page-footer-js-cancel')
.attr('tabindex', '0')
.on('click keydown', (event) => {
event.preventDefault();
// clear existing data
state.$el.find('input:radio').prop('checked', false);

View File

@@ -86,3 +86,21 @@
}
}
.page-footer-js-cancel {
text-decoration: underline;
color: $govuk-blue;
cursor: pointer;
&:hover {
color: $link-hover-colour;
}
&:focus,
&:active, {
background: $yellow;
color: $govuk-blue;
outline: 3px solid $yellow;
}
}