Skip to content

fix(docs): avoid inline-flex on heading anchor links - #1899

Merged
nmn merged 1 commit into
meta:mainfrom
reginaldalfret:fix/docs-header-inline-flex
Sep 23, 2026
Merged

nmn merged 1 commit into
meta:mainfrom
reginaldalfret:fix/docs-header-inline-flex

Conversation

@reginaldalfret

Copy link
Copy Markdown
Contributor

Summary

Fixes #1898 by removing display: 'inline-flex' and gap: 8 from styles.anchor in packages/docs/src/components/mdx/Heading.tsx.

Problem

In Heading.tsx, the <a> element wrapping heading text was styled with display: 'inline-flex' and gap: 8. When headings contain mixed inline nodes (such as text adjacent to <code> tags, e.g. "Media queries and other @-rules"), flex layout treats each child node as a flex item, disrupting natural inline text flow and breaking multi-line wrapping on mobile/narrow viewports. The anchor icon (<Link>) is already a separate sibling element rendered outside the <a> tag.

Solution

Remove display: 'inline-flex' and gap: 8 from styles.anchor so that heading anchor links behave as standard inline text links with inherited color and no underline.

Closes #1898

Remove display: inline-flex and gap: 8 from styles.anchor in Heading.tsx to preserve normal inline text flow and allow long headings to wrap properly.

Closes meta#1898
Copilot AI lite review requested due to automatic review settings September 21, 2026 18:50
@meta-cla

meta-cla Bot commented Sep 21, 2026

Copy link
Copy Markdown

Hi @reginaldalfret!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown

@reginaldalfret is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

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

No unresolved review issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Updates MDX heading anchor styling to preserve natural inline text wrapping on narrow screens.

Changes:

  • Removes inline-flex and gap: 8 from heading anchor styles.
  • Preserves natural inline text flow.
File Description
packages/​docs/​src/​components/​mdx/​Heading.tsx Simplifies anchor styling for correct text wrapping.

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

@meta-cla

meta-cla Bot commented Sep 21, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 21, 2026
@nmn
nmn merged commit f8c875c into meta:main Sep 23, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use inline-flex on header links

3 participants