Skip to content

Commit

Permalink
Merge pull request #941 from alphagov/mb-sidebar-taxon-title-underline
Browse files Browse the repository at this point in the history
Workaround for IE8 bug on related link bullet points
  • Loading branch information
Mo Baig authored Mar 9, 2017
2 parents 6e11b83 + b68a267 commit cc256d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion app/assets/stylesheets/govuk-component/_taxonomy-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@
list-style-type: none;
line-height: 1.5;

// We use a pseudo element to add bullet points to related links. This
// makes the bullets clickable and highlights them on link hover. With
// this approach, IE8 erroneously applies the anchor tag's underline to
// the pseudo element. Specifying separate text-decoration rules for the
// anchor tag and a nested span fixes this.
a {
display: block;
text-decoration: none;

&:before {
content: "";
Expand All @@ -32,7 +38,10 @@
margin-left: -15px;
}
}

a span {
text-decoration: underline;
}
}
}

}
5 changes: 3 additions & 2 deletions app/views/govuk_component/taxonomy_sidebar.raw.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<li>
<%=
link_to(
related_item[:title],
related_item[:link],
data: {
track_category: 'relatedLinkClicked',
Expand All @@ -42,7 +41,9 @@
track_dimension_index: 29,
},
class: 'related-link',
)
) do
content_tag(:span, related_item[:title])
end
%>
</li>
<% end %>
Expand Down

0 comments on commit cc256d0

Please sign in to comment.