Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(link): Adjust external link icon styling to prevent line-breaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomheller committed Jan 14, 2022
1 parent 75d0231 commit dc2071a
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions libs/barista-components/style/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
$dark-link-hover-bg: rgba(255, 255, 255, 0.2);
$dark-link-active-bg: rgba(255, 255, 255, 0.3);

$external-link-icon-size: 1.06em;

@mixin dt-link-base() {
cursor: pointer;
text-decoration: none;
Expand All @@ -16,15 +14,16 @@ $external-link-icon-size: 1.06em;
text-decoration: underline;
}
&.dt-external:hover::after {
background: dt-external-link-icon($turquoise-700);
text-decoration: none;
background-image: dt-external-link-icon($turquoise-700);
}

&:active {
color: $turquoise-800;
text-decoration: underline;
}
&.dt-external:active::after {
background: dt-external-link-icon($turquoise-800);
background-image: dt-external-link-icon($turquoise-800);
}

&:focus {
Expand All @@ -46,7 +45,7 @@ $external-link-icon-size: 1.06em;
background-color: $dark-link-hover-bg;
}
&.dt-external:hover::after {
background: dt-external-link-icon(#ffffff);
background-image: dt-external-link-icon(#ffffff);
}

&:active {
Expand All @@ -55,7 +54,7 @@ $external-link-icon-size: 1.06em;
background-color: $dark-link-active-bg;
}
&.dt-external:active::after {
background: dt-external-link-icon(#ffffff);
background-image: dt-external-link-icon(#ffffff);
}

&:focus {
Expand All @@ -74,14 +73,13 @@ a.dt-link {

&.dt-external::after {
content: ' ';
display: inline-block;
position: relative;
bottom: -0.05em;
margin-left: 4px;
background: dt-external-link-icon();
vertical-align: -0.1em;
width: $external-link-icon-size;
height: $external-link-icon-size;
display: inline;
margin-left: 8px;
background-image: dt-external-link-icon();
background-repeat: no-repeat;
background-size: contain;
padding-left: 1em;
vertical-align: -0.05em;
background-size: 100% 100%;
}
}
Expand Down

0 comments on commit dc2071a

Please sign in to comment.