Skip to content

Commit

Permalink
feat(scss): Implement marking of external URLs in CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
etu committed Jul 8, 2024
1 parent 97be9de commit 74d04e9
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@ html {
&:visited {
color: var(--link-visited-color);
}

&[href^="mailto"]::after,
&[href^="http"]::after,
&[href^="https://"]::after {
content: "";
width: 11px;
height: 11px;
margin-left: 4px;
background-image: url("/img/external-arrow-dark.svg");
background-position: center;
background-repeat: no-repeat;
background-size: contain;
display: inline-block;

@media (prefers-color-scheme: dark) {
background-image: url("/img/external-arrow-light.svg");
}
}
}

/*************************************************************
Expand Down
61 changes: 61 additions & 0 deletions src/static/img/external-arrow-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions src/static/img/external-arrow-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74d04e9

Please sign in to comment.