Skip to content

Set the markdown <hr> thickness to 1px ($border-width) - #3157

Open
dapirian wants to merge 1 commit into
mainfrom
dapirian/markdown-hr-thickness
Open

Set the markdown <hr> thickness to 1px ($border-width)#3157
dapirian wants to merge 1 commit into
mainfrom
dapirian/markdown-hr-thickness

Conversation

@dapirian

@dapirian dapirian commented Sep 2, 2026

Copy link
Copy Markdown

--- (the markdown thematic break) currently renders as a 4px solid bar. This changes it to a standard 1px rule.

I did not expect to develop strong feelings about a four-pixel line this week, and yet.

Everywhere else in the system, rules and edges use the $border-width (1px) border token: headings, tables, blockquote. The <hr> is the exception. It uses a spacing token, $em-spacer-3 (0.25em / 4px), as a thickness, which makes it roughly 4x heavier than the equivalent line in every other markdown renderer.

Change: set the <hr> thickness to $border-width (1px) instead of $em-spacer-3 (0.25em / 4px). That is the only change: same margins, same full width, same solid fill, just 1px. $border-width is Primer's line-thickness token (already used for the system's other rules), so the divider tracks it if it ever changes, rather than borrowing a spacing token as a thickness.

Why

  • Consistency with Primer's own weight. $border-width (1px) is the token used for every other rule in the system; the <hr> is the only place a spacing token stands in for a line weight.
  • Peer norm. Browser defaults, VS Code's markdown preview, Bootstrap, Tailwind Typography, Notion, Linear, Medium, Material (1dp), and Apple's HIG separators all land at ~1px. GitHub's 4px is the outlier.

Why this belongs in @primer/css (which is in KTLO mode). There is no newer package for it to move to. .markdown-body styles server-rendered markdown output, plain HTML emitted by the markdown pipeline, which primer/react and primer/view_components components do not produce and cannot style. It is a global stylesheet concern, which is what @primer/css still owns, so a one-line tweak to this existing, still-shipped rule belongs here rather than as new work in a component library.

Heads-up for reviewers: .markdown-body is a widely-inherited default, so this is a visible change anywhere Primer-styled markdown renders. Flagging for design review rather than treating it as routine.

Evidence: how other renderers and design systems draw this line
Source Divider / hr weight
Browser default (Blink / Gecko / WebKit) ~1px hairline
VS Code markdown preview 1px
Bootstrap 5 1px (25% opacity)
Tailwind Typography (prose) 1px
Notion divider ~1px
Slack / Linear UI dividers ~1px
Medium section break ~1px (or a 3-dot asterism)
Material Design divider 1dp
Apple HIG separator 1px hairline (0.5pt on Retina)
GitHub markdown <hr> 4px solid bar

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c884d48

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

This PR includes changesets to release 1 package
Name Type
@primer/css 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

The markdown thematic break (hr) rendered at 4px via the $em-spacer-3
spacing token, roughly 4x the ~1px used by every other markdown renderer
and by Primer's own rules (headings, tables, and blockquote all use
$border-width). Use $border-width for the hr so it matches the system's
line weight and tracks the token if it ever changes.

Only the existing $border-width token is used; no new tokens or API.
Passes stylelint with no new disables.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is minimal, token-consistent with existing Primer borders, and includes an appropriate changeset entry.

Review tier: Lite
Findings: None

What changed in this PR

Adjusts Primer’s rendered markdown thematic break (<hr>) to use the standard border thickness token, bringing .markdown-body in line with the rest of the system’s rule/edge styling.

Changes:

  • Update .markdown-body hr height from $em-spacer-3 (4px) to $border-width (1px).
  • Add a changeset to publish the visual adjustment as a patch release for @primer/css.
File Description
src/​markdown/​markdown-body.scss Switches <hr> thickness to $border-width while keeping existing spacing/color behavior.
.changeset/​markdown-hr-thickness.md Records the change for a patch release of @primer/css.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants