Skip to content

Conversation

rezrah
Copy link
Collaborator

@rezrah rezrah commented Jul 1, 2025

Summary

Towards https://github.com/github/brand-and-marketing-epd/issues/671
Resolves #988

This update makes it easier to distinguish between h2 and h3 elements in the Prose component, which were previously too similar in size.

🔗 Preview link

List of notable changes:

  • Updated Prose headings

    • h3 reduced from size-500 to size-400
    • h4 reduced from size-400 to size-300
    • h5 reduced from subhead-large to subhead-medium
    • h2 and h6 are unchanged
  • Added a h1 to one of our Prose stories

What should reviewers focus on?

Note: Previous suggestion from Office Hours was to increase the h2 to 28px on narrow viewports in Prose. This wasn't feasible, as we'd need to override a specific (narrow) breakpoint in in our preset typescale. The number of overrides required for this would risk a wider divergence between our primary type scale and Prose implementation. We also can't increase the h2 overall type scale position as that will increase tablet and desktop sizes too.

This PR instead updates Prose headings in the other direction. H1 and H2 remain unchanged, and everything H3+ is now smaller. This should also reduce visual regressions on resource pages, as most pages utilize h1-h4 ranges, rarely using h5 or h6.

Steps to test:

  1. Refer to these Storybook examples and check if anything looks odd
  2. Review the visual diffs, in before/after mode for anything that looks odd

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Test from a case study page on github.com:

Before After

Screenshot 2025-07-01 at 10 28 04

Screenshot 2025-07-01 at 10 27 48

From Storybook:

Before After

Screenshot 2025-07-01 at 11 06 12

Screenshot 2025-07-01 at 11 07 00

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 10:05
Copy link

changeset-bot bot commented Jul 1, 2025

🦋 Changeset detected

Latest commit: b89e4d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-css Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 1, 2025

🟢 No design token changes found

@rezrah rezrah changed the title Rezrah/update prose heading levels Update heading sizes in the Prose component Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

Copy link

@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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

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

Works great!

Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

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

Works great!

Copy link

@simmonsjenna simmonsjenna left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@kellyquesnel kellyquesnel merged commit cfe8c0b into main Jul 1, 2025
18 checks passed
@kellyquesnel kellyquesnel deleted the rezrah/update-prose-heading-levels branch July 1, 2025 16:18
@primer-css primer-css mentioned this pull request Jul 1, 2025
kellyquesnel added a commit that referenced this pull request Jul 1, 2025
@kellyquesnel
Copy link

kellyquesnel commented Jul 1, 2025

meep, sorry y'all. i accidentally hit the wrong button... * * sweats profusely * *

@rezrah
Copy link
Collaborator Author

rezrah commented Jul 1, 2025

All good @kellyquesnel, it was ready to merge anyway. Thanks for taking a look and approving it.

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.

[Modification request] Allow for headings in Prose component to be more distuinguishable
6 participants