Skip to content

[docs] fix callout icon alignment#1433

Merged
mellyeliu merged 3 commits intofacebook:mainfrom
alexcarpenter:alexcarpenter/docs-callout-icon-alignment
Jan 5, 2026
Merged

[docs] fix callout icon alignment#1433
mellyeliu merged 3 commits intofacebook:mainfrom
alexcarpenter:alexcarpenter/docs-callout-icon-alignment

Conversation

@alexcarpenter
Copy link
Contributor

@alexcarpenter alexcarpenter commented Jan 4, 2026

What changed / motivation ?

The docs <Callout /> icon alignment was not aligned to the first line of text.

Screenshot 2026-01-04 at 10 17 14 AM

Note

Looks like title usage within Callouts is roughly aligned, but not when titles are omitted. But unclear why the titles are 14px when the text within the callouts are rendering at 16px. We could conditionally apply the height based on whether a title is used or not.

Linked PR/Issues

Fixes # (issue)

Additional Context

BEFORE AFTER
Screenshot 2026-01-04 at 10 17 14 AM Screenshot 2026-01-04 at 10 16 59 AM

Pre-flight checklist

@vercel
Copy link

vercel bot commented Jan 4, 2026

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

A member of the Team first needs to authorize it.

@meta-cla
Copy link

meta-cla bot commented Jan 4, 2026

Hi @alexcarpenter!

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!

flexShrink: 0,
width: 20,
height: 20,
height: 'calc(16px * 1.65)',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Match the height of the icon to the line-height of the text to vertically align the icon to the first line of text.

@meta-cla
Copy link

meta-cla bot commented Jan 4, 2026

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 Jan 4, 2026
@alexcarpenter alexcarpenter changed the title fix(docs): Callout icon alignment [docs]: Fix callout icon alignment Jan 4, 2026
@alexcarpenter alexcarpenter changed the title [docs]: Fix callout icon alignment [docs] fix callout icon alignment Jan 4, 2026
flexShrink: 0,
width: 20,
height: 20,
height: 'calc(16px * 1.65)',
Copy link
Contributor Author

@alexcarpenter alexcarpenter Jan 4, 2026

Choose a reason for hiding this comment

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

const iconStyles = stylex.create({
  base: {
    flexShrink: 0,
    width: 20,
    height: 'calc(16px * 1.65)',
    marginInlineEnd: -2,
    color: vars['--color-fd-card'],
    fill: vars['--color-fd-card'],
  },
+  withTitle: {
+    height: 'calc(14px * 1.5)',
+  },
  info: { fill: vars['--color-fd-info'] },
  warning: { fill: vars['--color-fd-warning'] },
  error: { fill: vars['--color-fd-error'] },
  success: { fill: vars['--color-fd-success'] },
});

When a title is used, we could conditionally apply an override to the height since the title font size is 14px with 1.5 line-height.

Copy link
Contributor Author

@alexcarpenter alexcarpenter Jan 4, 2026

Choose a reason for hiding this comment

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

added check for title usage here 7b9cbf3

with and without title usage alignment:

Screenshot 2026-01-04 at 2 52 45 PM

@mellyeliu
Copy link
Member

Please run prettier on the changes!

@mellyeliu mellyeliu merged commit a9e8146 into facebook:main Jan 5, 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.

2 participants