Skip to content

🐛 Heading links - Keep red heading links red and darken on hover - #5137

Merged
tiagov8 merged 3 commits into
mainfrom
fix/5135-red-heading-link-hover
Nov 3, 2026
Merged

tiagov8 merged 3 commits into
mainfrom
fix/5135-red-heading-link-hover

Conversation

@tiagov8

@tiagov8 tiagov8 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #5135

Problem

Markdown ## headings render red (typography config: prose → h2 → sswRed), but a link inside one picked up the body-link styling: the prose link colour (near-black) by default, then the global a:hover red on hover. On /company/news, e.g. "MAY 2024 - SSW acquired TinaCMS", the linked word showed black inside an otherwise red heading.

Screenshot 2026-10-29 at 10 15 06 AM

❌ Figure: Bad example - Black links in red headings

Fix

One rule in styles.css (components layer):

.prose h2 a:not(.unstyled) {
  color: inherit;              /* stay the heading's red */
  @apply hover:text-sswDarkRed; /* #8e2c2c, same as the homepage button hover */
}
  • Specificity beats both prose's :where(a) link colour and the global a:not(.unstyled):hover red, so no !important needed.
  • Scoped to links inside prose h2s (the red markdown headings used site-wide), so body links and non-red headings (h3/h4) are untouched. .unstyled links opt out as usual.
  • Underline behaviour is unchanged (grey, turning red on hover).

Verified the rule compiles with the project Tailwind config to color: inherit and :hover { color: rgb(142 44 44) }.

Test

On /company/news, the headings with links (e.g. SSW acquired TinaCMS) stay red, and turn darker red on hover instead of black → red.


🤖 Changes made by Claude Opus 5.5 via Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 17:11

This comment was marked as low quality.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🔴 Statements 6.73% 3589/53363
🔴 Branches 40.13% 382/952
🔴 Functions 16.69% 100/599
🔴 Lines 6.73% 3589/53363

Test suite run success

134 tests passing in 17 suites.

Report generated by 🧪jest coverage report action from 6eb39da

@tiagov8
tiagov8 enabled auto-merge (squash) November 2, 2026 23:49

@designbyalex designbyalex left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this by adding the rule to production /company/news in my browser. All 17 heading links stay red and darken to #8e2c2c on hover, matching the homepage button. Nice scoping with color: inherit.

TinaCMS link in the news heading: near-black on production today, red with this PR

Comment thread styles.css
instead of turning black like body links */
.prose h2 a:not(.unstyled) {
color: inherit;
@apply hover:text-sswDarkRed;

@designbyalex designbyalex Nov 3, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: on hover the underline still turns brand red (the global a:hover sets decoration-sswRed), so it sits lighter than the dark-red text. The Design System matches the underline to the text on hover (the accordion trigger uses hover:text-primary hover:decoration-primary). Add hover:decoration-sswDarkRed here?

Hover today: dark-red text over a lighter red underline. Suggested: both dark red

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks. Fixed in #5146: the underline now darkens to sswDarkRed along with the text on hover.


🤖 Comment written by Claude Opus 5.5 via Claude Code

Comment thread styles.css

/* Links in red prose headings keep the heading's red and darken on hover,
instead of turning black like body links */
.prose h2 a:not(.unstyled) {

@designbyalex designbyalex Nov 3, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: base pages use prose-h2:text-black, so links in those black headings will hover dark red too. Is that intended (AC 5)? h1 > strong is also red in the typography config, and this rule doesn't cover it. No page has either case today, so it's fine to leave.

Demo link in a black base-page heading: black at rest, dark red on hover

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intended, so it's fixed in #5146 rather than left as is. The red-link style now applies only to headings that are actually red:

  • Base pages (prose-h2:text-black) and the client story dialog (prose-headings/prose-strong:text-foreground) keep the standard link style, which covers AC5.
  • Red h1 > strong headings are now covered too.

🤖 Comment written by Claude Opus 5.5 via Claude Code

@tiagov8
tiagov8 merged commit b42202f into main Nov 3, 2026
8 checks passed
@tiagov8
tiagov8 deleted the fix/5135-red-heading-link-hover branch November 3, 2026 03:23
tiagov8 added a commit that referenced this pull request Nov 5, 2026
…5146)

Closes #5135

Follow-up to #5137, from @designbyalex's review. When a link in a red
heading is hovered, its underline now darkens with the text. The
red-link style is also limited to headings that are actually red.

## What changed

- **The underline matches the text on hover.** Before, the text went
dark red but the global `a:hover` rule kept the underline brand red.
Both are now `sswDarkRed` (`#8e2c2c`), matching the Design System's
hover pattern.
- **Only red headings get the style.** #5137 applied it to every `.prose
h2`, so links in headings a page recolours turned dark red on hover too.
Those pages now keep the standard link style:
  - Base pages, which use `prose-h2:text-black`.
- The client story dialog, which uses `prose-headings:text-foreground`
and `prose-strong:text-foreground`.

  This covers #5135's AC5: no other standard link styles are affected.
- **Red `h1 > strong` headings are covered too.** They're red in the
typography config, the same as `h2`.

## Risky areas

- **`styles.css` is global.** The rule excludes heading colour overrides
by exact class name, so a page that recolours prose headings some other
way would still get red links. The comment above the rule says to add
new overrides to the `:not()` lists.
- **Not every override is a colour.** `prose-h2:text-3xl/9` (a size,
used by `companyPageCard`) is not excluded, so those red headings keep
the red-link style.

---
🤖 Changes made by **Claude Opus 5.5** via [Claude
Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug - Heading links use incorrect hover styling

3 participants