Skip to content
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

fix(heading): improve heading style #7628

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

AugustinMauroy
Copy link
Member

@AugustinMauroy AugustinMauroy commented Apr 7, 2025

Description

Fix bugs introduced by migration of tailwind v4 or monorepo.

Validation

  • Headings with anchor shouldn't not change color when hoverd
  • correctly displayed when inline code is inside a code

Related Issues

No related issues just slack discussion

Check List

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

@AugustinMauroy AugustinMauroy added fast-track Fast Tracking PRs github_actions:pull-request Trigger Pull Request Checks labels Apr 7, 2025
@Copilot Copilot bot review requested due to automatic review settings April 7, 2025 09:19
@AugustinMauroy AugustinMauroy requested a review from a team as a code owner April 7, 2025 09:19
Copy link

vercel bot commented Apr 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Apr 7, 2025 9:22am

Copy link
Contributor

github-actions bot commented Apr 7, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟠 81 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 99 🟢 100 🟢 96 🟢 92 🔗

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • packages/ui-components/styles/markdown.css: Language not supported
  • packages/ui-components/styles/theme.css: Language not supported

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Augustin Mauroy <[email protected]>
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Unit Test Coverage Report

Title Lines Statements Branches Functions
@node-core/ui-components Coverage: 95%
95.83% (161/168) 77.86% (102/131) 88.57% (31/35)
@nodejs/website Coverage: 87%
84.73% (494/583) 76.03% (165/217) 86.99% (107/123)
Title Tests Skipped Failures Errors Time
@node-core/ui-components 24 0 💤 0 ❌ 0 🔥 5.268s ⏱️
@nodejs/website 156 0 💤 0 ❌ 0 🔥 6.657s ⏱️

@@ -75,7 +75,8 @@ main {
dark:text-white;
}

a,
/* link that isn't inside a heading */
a:not(h1 > a):not(h2 > a):not(h3 > a):not(h4 > a):not(h5 > a):not(h6 > a),
Copy link
Member

Choose a reason for hiding this comment

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

CSS 😎

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah 🤘🏻

@@ -95,7 +94,7 @@
--font-xs-line-height: 1rem;
--font-sm: 0.87rem;
--font-sm-line-height: 1.25rem;
--font-base: 1rem;
--font-base: 0.9rem;
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, did we not use something else before? What were we using for defining base font size?

Copy link
Member Author

Choose a reason for hiding this comment

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

IDK maybe coming from codemod ?

Copy link
Member

Choose a reason for hiding this comment

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

Can you check what was the original value?

Copy link
Member Author

Choose a reason for hiding this comment

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

fontSize: {
xs: ['0.75rem', '1rem'],
sm: ['0.875rem', '1.25rem'],
base: ['1rem', '1.5rem'],
lg: ['1.125rem', '1.75rem'],
xl: ['1.25rem', '1.875rem'],
'2xl': ['1.5rem', '2rem'],
'3xl': ['1.875rem', '2.25rem'],
'4xl': ['2.25rem', '2.5rem'],
'5xl': ['3rem', '3rem'],
'6xl': ['3.75rem', '3.75rem'],
'7xl': ['4.5rem', '4.5rem'],
},
fontWeight: {
regular: '400',
medium: '500',
semibold: '600',
bold: '700',
},

Copy link
Member

Choose a reason for hiding this comment

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

I looked to the Wayback machine and apparently it was always 16px. That's interestingly odd. Let's undo this change then and keep base as 1rem.

Copy link
Member

Choose a reason for hiding this comment

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

It just feels odd to me that the content font size is larger than, for example, the sidebar or other elements such as tables and so on. What do you all think, @nodejs/nodejs-website?

Copy link
Member

Choose a reason for hiding this comment

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

The font values weren't updated by the codemod, i had to do it manually :(.

I'm trying to figure out what's different compared to what's in production, but I can't spot any difference.

@avivkeller avivkeller changed the title Fix heading style fix(heading): improve heading style Apr 8, 2025
@avivkeller
Copy link
Member

No related issues just slack discussion

For posterity, can you link the slack discussion?

@AugustinMauroy
Copy link
Member Author

For posterity, can you link the slack discussion?

Normally it's okay now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track Fast Tracking PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants