diff --git a/assets/css/global.css b/assets/css/global.css index 5f336ca857..5ceb76c5b9 100644 --- a/assets/css/global.css +++ b/assets/css/global.css @@ -18,6 +18,12 @@ @apply text-blue-light underline underline-offset-2 dark:text-blue-dark; } + .external-link { + .icon:after { + @apply text-base ml-1; + } + } + .invertible { @apply dark:hue-rotate-180 dark:invert dark:filter; } diff --git a/assets/css/icons.css b/assets/css/icons.css new file mode 100644 index 0000000000..73155e8af6 --- /dev/null +++ b/assets/css/icons.css @@ -0,0 +1,19 @@ +@layer utilities { + .icon { + font-family: "Material Symbols Rounded"; + font-weight: normal; + font-style: normal; + font-size: 24px; /* Preferred icon size */ + display: inline-block; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + } + + .icon:after { + content: attr(data-icon); + } +} diff --git a/assets/css/styles.css b/assets/css/styles.css index 0ab8a14e0d..28c30294e8 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -14,3 +14,4 @@ @import "tailwindcss/utilities"; @import "/assets/css/syntax-light"; @import "/assets/css/syntax-dark"; +@import "/assets/css/icons"; diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 843f84175c..4775116a6b 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -2,16 +2,12 @@ {{- if (strings.HasPrefix $url "http") -}} {{/* external link, add icon */}} {{ .Text | safeHTML }}open_in_new + class="icon" data-icon="open_in_new"> {{- else if (strings.HasPrefix $url "/") -}} {{/* absolute link, use url as-is */}} {{ .Text | safeHTML }} diff --git a/layouts/partials/github-links.html b/layouts/partials/github-links.html index 662cc64d4b..b981d2514a 100644 --- a/layouts/partials/github-links.html +++ b/layouts/partials/github-links.html @@ -3,18 +3,18 @@ {{ if not (in .Filename "/_vendor/") }}
{{ end }} {{ end }} {{ end }}