Skip to content

Commit 564fdaa

Browse files
committed
Include more top-level domains
1 parent 6fb47a9 commit 564fdaa

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

assets/scss/_styles_project.scss

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,30 @@ a:not(.btn):not(.td-sidebar-link):visited {
231231
color: $purple;
232232
}
233233

234-
// Add icon after external links (but exclude buttons and the right sidebar icons)
235-
a[href*=".com"]:not([href*="github.com/mendix/"]):not(.btn)::after,
236-
a[href*=".org"]:not(.btn)::after {
237-
display: inline-block;
238-
width: 1rem;
239-
height: 1rem;
240-
margin-left: .2rem;
241-
vertical-align: sub;
242-
content: url("/icons/external-unvisited.svg"); // Fill color is $link-color (blue-8 from PDS). Keep it updated with _variables_project.scss.
234+
// Define list of top-level domains
235+
$tlds: ".co", ".org", ".io", ".net", ".gov", ".edu", ".nl", ".de";
236+
237+
// Add external icon after links with the specified domains
238+
main a {
239+
@each $tld in $tlds {
240+
&[href*="#{$tld}"]:not(.btn)::after {
241+
display: inline-block;
242+
width: 1rem;
243+
height: 1rem;
244+
margin-left: .2rem;
245+
vertical-align: sub;
246+
content: url("/icons/external-unvisited.svg"); // Fill color is $link-color (blue-8 from PDS). Keep it updated with _variables_project.scss.
247+
}
248+
}
243249
}
244250

245-
// Use icon with different fill color when link is hovered over
246-
a[href*=".com"]:hover:not([href*="github.com/mendix/"]):not(.btn)::after,
247-
a[href*=".org"]:hover:not(.btn)::after {
248-
content: url("/icons/external-hover.svg"); // Fill color is $link-hover-color (blue-9 from PDS). Keep it updated with _variables_project.scss.
251+
// Change external link icon (color) upon hover
252+
main a {
253+
@each $tld in $tlds {
254+
&[href*="#{$tld}"]:hover:not(.btn)::after {
255+
content: url("/icons/external-hover.svg"); // Fill color is $link-color (blue-8 from PDS). Keep it updated with _variables_project.scss.
256+
}
257+
}
249258
}
250259

251260
.btn {

0 commit comments

Comments
 (0)