Skip to content

🐛 Fixed callout card accent links invisible in newsletter emails#27320

Open
andrewklingelhofer wants to merge 1 commit intoTryGhost:mainfrom
andrewklingelhofer:fix/callout-accent-link-color
Open

🐛 Fixed callout card accent links invisible in newsletter emails#27320
andrewklingelhofer wants to merge 1 commit intoTryGhost:mainfrom
andrewklingelhofer:fix/callout-accent-link-color

Conversation

@andrewklingelhofer
Copy link
Copy Markdown

@andrewklingelhofer andrewklingelhofer commented Apr 9, 2026

fixes #27317

Summary

  • The CSS refactor in e1fffbb moved shared card styles into a separate partial (card-styles.hbs) that gets included before newsletter-specific styles in styles.hbs. This changed the source order so that .post-content a { color: {{linkColor}} } (line ~555) now appears after .kg-callout-card-accent a { color: #fff } (from card-styles.hbs included at line 26). Since both selectors have the same specificity (0,1,0,1), the later rule wins and overrides the white link color with {{linkColor}}, making links invisible on accent-colored callout backgrounds.
  • Added !important to .kg-callout-card-accent a { color: #fff; } to preserve white link text regardless of source order, consistent with CTA card link styles in the same file.

Test plan

  • Create a post with a callout card using the accent background option
  • Add a link inside the callout text
  • Preview as email — link text should be white, not the accent/link color
  • Verified locally: integration tests pass, email preview confirmed fix

Note

Low Risk
Low risk CSS-only change limited to email rendering; primary risk is unintended link color overrides in accent callout cards across email clients due to !important.

Overview
Fixes newsletter email rendering where links inside accent-colored callout cards could inherit the global link color and become unreadable.

Updates .kg-callout-card-accent a in card-styles.hbs to set color: #fff !important, ensuring white link text wins regardless of stylesheet source order.

Reviewed by Cursor Bugbot for commit 414e1a5. Bugbot is set up for automated code reviews on this repo. Configure here.

fixes TryGhost#27317

The CSS refactor in e1fffbb moved shared card styles into a separate
partial (card-styles.hbs) that gets included before newsletter-specific
styles. This changed the source order so that `.post-content a` (from
styles.hbs) now appears after `.kg-callout-card-accent a` (from
card-styles.hbs). Since both selectors have the same specificity
(0,1,0,1), the later rule wins and link text gets the linkColor instead
of white, making it invisible on the accent background.

Adding !important to the callout accent link rule ensures white text is
preserved regardless of source order, consistent with how CTA card link
colors already use !important in the same file.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 38d95618-d58f-4ed9-b4dd-9821c5f874dc

📥 Commits

Reviewing files that changed from the base of the PR and between 7e56995 and 414e1a5.

📒 Files selected for processing (1)
  • ghost/core/core/server/services/email-rendering/partials/card-styles.hbs

Walkthrough

A CSS declaration in the email rendering partial for card styles has been modified to increase specificity. The color property for links within the callout card accent element now includes the !important flag. The change affects how link text color is applied when a callout card uses the accent background option in email rendering, ensuring the declared color value takes precedence during CSS processing.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main fix: addressing invisible callout card accent links in newsletter emails caused by CSS specificity.
Description check ✅ Passed The description comprehensively explains the root cause, the CSS change made, and the test plan, all directly related to the changeset.
Linked Issues check ✅ Passed The PR fully addresses issue #27317 by adding !important to the .kg-callout-card-accent a CSS rule to ensure white link text on accent backgrounds in emails.
Out of Scope Changes check ✅ Passed All changes are narrowly scoped to fixing the CSS specificity issue in the callout card accent link rule, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

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.

Email: callout card accent background makes links invisible (accent color overrides white)

1 participant