Skip to content

Conversation

@Ju-MINJAE
Copy link
Contributor

@Ju-MINJAE Ju-MINJAE commented Oct 31, 2025

Fixes #8290

Description

Fixed CSS specificity conflict between AlertBox and markdown content styles.

The issue was not with the AlertBox background color, but with paragraph (<p>) tags inside AlertBox inheriting black text color from markdown styles instead of maintaining white text. Added !important to override markdown paragraph styles and ensure text remains white.

Changes

  • Added * { color: white !important; } to AlertBox styles
  • Kept background at bg-info-600 as per design system
  • Resolved CSS conflict between AlertBox component and markdown content

Validation

How to test:

  1. Run pnpm dev
  2. Navigate to any blog page with AlertBox in markdown content (e.g., /blog/migrations)
  3. Verify the AlertBox text is white, not black

Before:

image

After:

image

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

- Change info background from bg-info-600 to bg-info-400
- Improves text contrast ratio to meet WCAG 2.1 AA standards
- Ensures better readability for users with visual impairments

The darker background (info-400) provides better contrast with
white text, meeting the minimum 4.5:1 contrast ratio requirement.

Fixes nodejs#8290
@Ju-MINJAE Ju-MINJAE requested a review from a team as a code owner October 31, 2025 08:35
@vercel
Copy link

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Nov 1, 2025 2:05am

@Ju-MINJAE
Copy link
Contributor Author

Please let me know if you'd prefer different shade values for better contrast or design consistency.

@AugustinMauroy
Copy link
Member

Yup thanks for being volonture. But on our design syteme in light theme the bg should stay as it but the text should be withe. If you take a look on may branch in storybook the alertBox is correct.

Is a css conflict with style from AlertBox and markdown content style. because the p tag inside the alertBox take the style of a basic paragraph it's why it's black

@Ju-MINJAE
Copy link
Contributor Author

@AugustinMauroy like this?

image

@AugustinMauroy
Copy link
Member

@AugustinMauroy like this?

image

YEAH !

- Keep background color at bg-info-600 as per design system
- Add !important to paragraph color to override markdown styles
- Fix text color conflict where p tags inherit markdown paragraph styles

The issue was a CSS specificity conflict. Paragraph elements inside
AlertBox were inheriting black text color from markdown styles instead
of maintaining the white text color defined in AlertBox styles.

Fixes nodejs#8290
Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT !

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

What if the child is a span? div?

Can we use a more broad selector?

@avivkeller
Copy link
Member

I'd prefer a broader selector, ie a wildcard

@Ju-MINJAE
Copy link
Contributor Author

@avivkeller Got it!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 98 🟠 88 🟢 100 🟢 100 🔗
/en/about 🟢 100 🟢 93 🟢 100 🟠 88 🔗
/en/about/previous-releases 🟢 99 🟢 93 🟢 100 🟢 100 🔗
/en/download 🟢 97 🟢 96 🟢 100 🟢 100 🔗
/en/download/archive/current 🟢 100 🟢 100 🟢 100 🟢 100 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 100 🔗

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.61%. Comparing base (5d2362f) to head (bf49718).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8297   +/-   ##
=======================================
  Coverage   76.61%   76.61%           
=======================================
  Files         117      117           
  Lines        9746     9751    +5     
  Branches      328      328           
=======================================
+ Hits         7467     7471    +4     
- Misses       2277     2278    +1     
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AugustinMauroy AugustinMauroy added this pull request to the merge queue Nov 2, 2025
Merged via the queue into nodejs:main with commit 4950c1d Nov 2, 2025
20 checks passed
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.

Poor color contrast on Alert

3 participants