From d35a560563981d55ac59d2e58d094ca33978cf9e Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:24:04 +0800 Subject: [PATCH] Add an icon to external links --- src/assets/css/general.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/assets/css/general.css b/src/assets/css/general.css index d1690e01..5b83c9a7 100644 --- a/src/assets/css/general.css +++ b/src/assets/css/general.css @@ -51,6 +51,25 @@ a:hover { color: var(--clr-link-hover); } a:not([class]):focus { outline: 0.15rem solid var(--clr-link); } a:hover img, a:focus img { outline: 0.2em solid var(--clr-body-txt); } +a[href^="http"]:not(:has(img, svg, figure)) { padding-right: 1.25em; } +a[href^="http"]:not(:has(img, svg, figure))::after { + position: absolute; + content: ""; + display: inline-block; + width: 1em; + height: 1em; + margin-left: 0.25em; + background-color: var(--clr-link); + mask-size: 100%; + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewbox='0 0 12.2 12.2' width='14' height='14'%3E%3Cpath d='M5.7 0v1.5h4L4.5 6.7l1 1.1 5.3-5.2v3.9h1.4V0z'/%3E%3Cpath fill='none' d='M3.4 6.7l3-2.9H1.5v7h7V5.9l-3 2.9z'/%3E%3Cpath d='M8.5 5.9v4.9h-7v-7h4.9l1.5-1.6H0v10h10V4.4z'/%3E%3C/svg%3E"); + mask-repeat: no-repeat; + transform: translateY(0.25em); +} + +a[href^='http']:not(:has(img, svg, figure)):hover::after { + background-color: var(--clr-link-hover); +} + :not(.c-blockquote) > blockquote, .c-blockquote { padding: 1em 1.4em 1.4em;