Skip to content

Commit 310fab2

Browse files
authored
Merge pull request #1196 from AtCoder-NoviSteps/#1195
🎨 Update external link icon (#1195)
2 parents 0fa9c17 + 73fb380 commit 310fab2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/lib/components/ExternalLinkIcon.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
<script lang="ts">
2+
export let size = 'w-6 h-6';
3+
</script>
4+
15
<!-- See: https://flowbite.com/icons/ -->
26
<svg
3-
class="w-6 h-6 text-gray-800 dark:text-white"
7+
class="{size} text-primary-600 dark:text-gray-300"
48
aria-hidden="true"
59
xmlns="http://www.w3.org/2000/svg"
610
fill="none"

src/lib/components/ExternalLinkWrapper.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script lang="ts">
2+
import ExternalLinkIcon from '$lib/components/ExternalLinkIcon.svelte';
3+
24
export let url: string;
35
export let description: string;
46
export let textSize: string = '';
@@ -7,21 +9,21 @@
79

810
<a
911
href={url}
10-
class="font-medium {textSize} text-primary-600 hover:underline {textColorInDarkMode}"
12+
class="inline-flex items-center font-medium {textSize} text-primary-600 hover:underline {textColorInDarkMode}"
1113
target="_blank"
1214
rel="noreferrer"
1315
>
1416
{description}
17+
18+
<div class="ml-1.5">
19+
<ExternalLinkIcon size="w-4 h-4" />
20+
</div>
1521
</a>
1622

1723
<!-- See: -->
1824
<!-- https://github.com/fastapi/fastapi/blob/master/docs/en/docs/css/custom.css -->
1925
<style>
2026
a::after {
21-
/* \00A0 is a non-breaking space
22-
to make the mark be on the same line as the link
23-
*/
24-
content: '\00A0[↪]';
2527
font-family: Roboto, Arial, sans-serif;
2628
position: relative;
2729
top: -0.1em;

0 commit comments

Comments
 (0)