Repository navigation
fix(docs): avoid inline-flex on heading anchor links - #1899
Conversation
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
|
Hi @reginaldalfret! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@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. |
There was a problem hiding this comment.
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-flexandgap: 8from 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.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
Fixes #1898 by removing
display: 'inline-flex'andgap: 8fromstyles.anchorinpackages/docs/src/components/mdx/Heading.tsx.Problem
In
Heading.tsx, the<a>element wrapping heading text was styled withdisplay: 'inline-flex'andgap: 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'andgap: 8fromstyles.anchorso that heading anchor links behave as standard inline text links with inherited color and no underline.Closes #1898