From 874234ade360cd638cf7184a5da60fceb5b7bce8 Mon Sep 17 00:00:00 2001 From: coseeian Date: Wed, 22 Jul 2026 13:09:54 +0800 Subject: [PATCH 1/4] feat: add underline to links within text --- styles/markdown.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/styles/markdown.scss b/styles/markdown.scss index d31606cc72..0a2a5ebcd4 100644 --- a/styles/markdown.scss +++ b/styles/markdown.scss @@ -18,8 +18,9 @@ max-width: variables.$breakpoint-tablet; } - a { + a:not(.button-link) { color: var(--type-magenta-dark); + text-decoration: underline; text-decoration-color: var(--type-magenta-dark); .dark-theme & { @@ -114,4 +115,4 @@ html[lang="ko"] .rendered-markdown { line-height: 1.7; // Prevent awkward Korean line breaks word-break: keep-all; -} \ No newline at end of file +} From d5b4e2a51d5de65315431c1c754a41b817c6f145 Mon Sep 17 00:00:00 2001 From: coseeian Date: Mon, 27 Jul 2026 17:52:02 +0800 Subject: [PATCH 2/4] fix: centralize text link styling with its underline --- src/components/EducationResource/index.astro | 4 +++- src/layouts/AboutLayout.astro | 14 +++----------- src/layouts/ReferenceItemLayout.astro | 4 ++-- src/layouts/SketchLayout.astro | 10 +++------- styles/global.scss | 17 +++++++++++++++++ styles/markdown.scss | 11 ----------- 6 files changed, 28 insertions(+), 32 deletions(-) diff --git a/src/components/EducationResource/index.astro b/src/components/EducationResource/index.astro index f1b0f88f4d..783b0a59a9 100644 --- a/src/components/EducationResource/index.astro +++ b/src/components/EducationResource/index.astro @@ -25,7 +25,9 @@ const authorHTML = (await Astro.slots.render("author")).replace(/\]*\>/gm,
-
+ +
diff --git a/src/layouts/AboutLayout.astro b/src/layouts/AboutLayout.astro index 40da4e2acf..3e984ca769 100644 --- a/src/layouts/AboutLayout.astro +++ b/src/layouts/AboutLayout.astro @@ -84,7 +84,7 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6); > -
+ -
+ -
+ - - diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index 5340f88b0d..d16adc5c3e 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -177,7 +177,7 @@ function normalizeP5ReferenceLinks(html: string | undefined): string | undefined return (
); } @@ -326,7 +326,7 @@ function normalizeP5ReferenceLinks(html: string | undefined): string | undefined { entry.data.file && entry.data.line &&(
-
+ diff --git a/styles/global.scss b/styles/global.scss index ce49368f82..5c2116ce00 100644 --- a/styles/global.scss +++ b/styles/global.scss @@ -201,6 +201,23 @@ a { } } +// Single source of truth for links styled as text rather than as a button. +// The color and the underline live together here so the two can't drift apart. +// Put .text-link on a link itself, or on any container to style every link +// inside it. Markdown-generated content gets the treatment automatically. +a.text-link:not(.button-link), +.text-link a:not(.button-link), +.rendered-markdown a:not(.button-link) { + color: var(--type-magenta-dark); + text-decoration: underline; + text-decoration-color: var(--type-magenta-dark); + + .dark-theme & { + color: var(--type-magenta); + text-decoration-color: var(--type-magenta); + } +} + code { @extend .text-body-mono; font-size: inherit; diff --git a/styles/markdown.scss b/styles/markdown.scss index 0a2a5ebcd4..11b1641770 100644 --- a/styles/markdown.scss +++ b/styles/markdown.scss @@ -18,17 +18,6 @@ max-width: variables.$breakpoint-tablet; } - a:not(.button-link) { - color: var(--type-magenta-dark); - text-decoration: underline; - text-decoration-color: var(--type-magenta-dark); - - .dark-theme & { - color: var(--type-magenta); - text-decoration-color: var(--type-magenta); - } - } - a.button-link { margin-top: var(--spacing-md); min-width: 180px; From af681b3202cb83d076868e36894024109aa97f57 Mon Sep 17 00:00:00 2001 From: coseeian Date: Mon, 27 Jul 2026 18:58:31 +0800 Subject: [PATCH 3/4] fix: restore hover underline on education resource material pills --- src/components/EducationResource/index.astro | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/EducationResource/index.astro b/src/components/EducationResource/index.astro index 783b0a59a9..685284016f 100644 --- a/src/components/EducationResource/index.astro +++ b/src/components/EducationResource/index.astro @@ -25,9 +25,11 @@ const authorHTML = (await Astro.slots.render("author")).replace(/\]*\>/gm,
- -
+ +
From 7595f80f62bfc4bdff02af766a95b86bdb82af6d Mon Sep 17 00:00:00 2001 From: coseeian Date: Mon, 27 Jul 2026 20:36:13 +0800 Subject: [PATCH 4/4] Update src/components/EducationResource/index.astro Co-authored-by: Kenneth Lim --- src/components/EducationResource/index.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/EducationResource/index.astro b/src/components/EducationResource/index.astro index 685284016f..086233550a 100644 --- a/src/components/EducationResource/index.astro +++ b/src/components/EducationResource/index.astro @@ -29,7 +29,7 @@ const authorHTML = (await Astro.slots.render("author")).replace(/\]*\>/gm, that .rendered-markdown links get, but keep the hover underline. The !important is needed to beat .rendered-markdown, and would otherwise kill :hover too -- hence the second utility. --> -
+