-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
fix: Ensure links maintain green color within bold text #7744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where links within or containing bold text were inheriting an incorrect color by explicitly overriding styles via additional CSS selectors and Tailwind utility overrides.
- Expanded CSS selectors to target links within bold text (using selectors such as "a strong", "strong a", and "p a").
- Enforced green color styling in both light and dark modes with ! overrides.
Comments suppressed due to low confidence (1)
packages/ui-components/styles/markdown.css:83
- [nitpick] The selector 'p a' is quite broad and might unintentionally override other paragraph link styles. Verify that this rule is scoped as intended or consider narrowing its specificity.
p a {
Wouldn't it make more sense to just not change the color on strongs (or just strong links) rather than making the green more important? Earlier in the file the "strong" styles are defined. Should they really be changing the colors in the first place? |
bc47b6a
to
ce8fb50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formally blocking based on my, and @bjohansebas's, comments. We don't think !important is the way to go.
- Remove color styling from `strong` so it only applies font weight, not color. - Restore color styling for headings only. - Remove unnecessary selectors and \!important overrides for link color. - This allows links within bold text to inherit the correct green color naturally, resolving the previous override issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the unwanted inheritance of white text color from bold (strong) elements on links by adjusting the CSS.
- Updated heading styles to include text color properties.
- Removed text color rules from the strong element to let links apply their green color.
Comments suppressed due to low confidence (1)
packages/ui-components/styles/markdown.css:54
- Removing the text color rules from the strong selector allows links inside to retain their green color, but please verify that strong text outside of links still adheres to the intended design system. Consider providing a fallback color or additional context styling if necessary.
@apply font-semibold;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some stories (storybook) for text could you try to cover these cases
Sure, I'll look into it. |
…edge cases - Adds a story to the text stories. - Demonstrates bold text, a link inside bold, and bold inside a link. - Ensures CSS changes are visually tested for all relevant markdown scenarios.
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7744 +/- ##
==========================================
+ Coverage 74.85% 74.87% +0.01%
==========================================
Files 98 98
Lines 7895 7895
Branches 200 200
==========================================
+ Hits 5910 5911 +1
+ Misses 1984 1983 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Lighthouse Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR fixes an issue where links within bold text (using markdown
**text**
syntax) were inheriting the white color from the strong tags instead of maintaining their green color. The fix adds specific CSS selectors to ensure links maintain their green color regardless of whether they are inside or contain bold text.Validation
The fix ensures that:
Before:


After:
Related Issues
This PR addresses the issue #7742 (Bold Links are not Green)
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.