Skip to content

Commit 468e8f8

Browse files
committed
Fix default links and external link icon position
1 parent 9827547 commit 468e8f8

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

src/img/static/external.svg

Lines changed: 3 additions & 0 deletions
Loading

src/scss/02-tools/_f-get-svg-url.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
// name-of-the-svg: (viewBox, content of the svg element)
4141
"arrow": ("0 0 18 14", "%3Cpath d='M17.25 7 10.37.12l-.96.97 5.2 5.22H.76V7.7h13.87L9.4 12.9l.96.96L17.25 7Z'/%3E"),
4242
"down": ("0 0 11.2 6.7", "3Cpath d='M0 .5C0 .4.1.2.2.1c.2-.2.5-.1.7.1l4.6 5.3.1.1s.1 0 .1-.1L10.3.1c.2-.1.5-.2.7 0 .2.2.2.5.1.7L6.5 6.2c-.2.3-.5.5-.9.5s-.7-.2-.9-.6L.1.8C0 .7 0 .6 0 .5z'/%3E"),
43-
"external": ("0 0 20 20", "3Cpath d='M3.1 19.6A3.1 3.1 0 0 1 0 16.4V3.1A3.2 3.2 0 0 1 3.1 0H4c.4 0 .7.3.7.7 0 .4-.3.8-.7.8H3c-.9 0-1.6.7-1.6 1.6v13.3c0 1 .7 1.7 1.6 1.7h13.2c.9 0 1.6-.8 1.6-1.7v-.8c0-.4.4-.7.8-.7s.7.3.7.7v.8c0 1.7-1.4 3.2-3.1 3.2H3ZM18.7 0c.4 0 .7.3.7.7v10c0 .4-.4.7-.8.7s-.7-.3-.7-.8V2.5l-9.7 9.8c-.3.2-.8.3-1 0a.7.7 0 0 1 0-1l9.7-9.8H8.8c-.5 0-.8-.3-.8-.7 0-.4.3-.8.8-.8h9.9Z'/%3E"),
4443
"close": ("0 0 20 20", "3Cpath d='M5.442 5.442 5 5.883l2.058 2.059L9.116 10l-2.058 2.058L5 14.117l.442.441.441.442 2.059-2.058L10 10.884l2.058 2.058L14.117 15l.441-.442.442-.441-2.058-2.059L10.884 10l2.058-2.058L15 5.883l-.442-.441L14.117 5l-2.059 2.058L10 9.116 7.942 7.058 5.883 5l-.441.442'/%3E"),
4544
);
4645

src/scss/02-tools/_m-text-icon.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
*/
1818

1919
@mixin text-icon($icon: "arrow", $position: after, $color: currentColor, $size: 12px, $gap: 8px) {
20-
position: relative;
2120
display: inline-flex;
2221
gap: $gap;
2322
align-items: center;
2423

2524
&::#{$position} {
2625
display: block;
2726
width: $size;
27+
min-width: $size;
2828
height: $size;
2929
content: "";
3030
background-color: $color;
31-
mask-image: get-svg-url($icon);
31+
mask-image: url(../img/static/#{$icon}.svg);
3232
mask-position: center;
3333
mask-repeat: no-repeat;
3434
transition: background-color .5s $ease-out-expo;
@@ -38,9 +38,11 @@
3838
@mixin text-external-icon($icon: "external", $position: after, $color: currentColor, $size: 12px, $gap: 8px) {
3939
@include text-icon($icon, $position, $color, $size);
4040
display: inline-block;
41+
gap: 0;
4142

4243
&::#{$position} {
4344
display: inline-block;
4445
margin-inline-start: $gap;
46+
vertical-align: middle;
4547
}
4648
}

src/scss/03-base/_links.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ a {
77
cursor: pointer;
88

99
&[target="_blank"] {
10-
@include text-icon("external");
10+
@include text-external-icon("external");
1111
}
1212

1313
@include hover {
1414
text-decoration: none;
1515
}
1616
}
1717

18+
a,
19+
button {
20+
text-decoration-thickness: 1px !important;
21+
text-underline-position: from-font;
22+
text-decoration-skip-ink: none;
23+
cursor: pointer;
24+
}
25+
1826
.link-external {
19-
@include text-icon("external");
27+
@include text-external-icon("external");
2028
}

0 commit comments

Comments
 (0)