Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-underline mixin and modifier class #2214

Merged
merged 2 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/views/examples/links/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
(<a class="govuk-link" href="#">Link with surrounding brackets</a>) test that the focus style does not overlap.
</p>

<p class="govuk-body">
<a class="govuk-link govuk-link--no-underline" href="#">Link with no underline</a>
</p>

{% for variant_description, variant_class in variants %}

<section class="govuk-!-margin-top-8">
Expand Down
4 changes: 4 additions & 0 deletions src/govuk/core/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
@include govuk-link-style-text;
}

.govuk-link--no-underline {
@include govuk-link-style-no-underline;
}

.govuk-link--no-visited-state {
@include govuk-link-style-no-visited-state;
}
Expand Down
13 changes: 13 additions & 0 deletions src/govuk/helpers/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,19 @@
}
}

/// No underline link mixin
///
/// Removes underlines from links (except on hover, or when the link is active).
/// This does not work in IE8, because IE8 does not support `:not`.
///
/// @access public

@mixin govuk-link-style-no-underline {
&:not(:hover):not(:active) {
text-decoration: none;
}
}

/// Print friendly link mixin
///
/// When printing, append the the destination URL to the link text, as long
Expand Down