Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(theme-classic): make tag text visually certered #7876

Merged
merged 2 commits into from Aug 9, 2022

Conversation

Kosai106
Copy link
Contributor

@Kosai106 Kosai106 commented Aug 1, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

The tag content was visually offset which looked out of place. This fixes it.

Test Plan

Manually verified.

Before After
Screenshot 2022-08-01 at 15 36 46 Screenshot 2022-08-01 at 15 36 35

@facebook-github-bot
Copy link
Contributor

Hi @Kosai106!

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@fb.com. Thanks!

@netlify
Copy link

netlify bot commented Aug 1, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 3bffc92
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62e7d79e57c64c000834b25d
😎 Deploy Preview https://deploy-preview-7876--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 68 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 75 🟢 100 🟢 100 🟢 100 🟢 90 Report

@netlify
Copy link

netlify bot commented Aug 1, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 358d4b4
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62e7d83d2d6cf400086f1f6e
😎 Deploy Preview https://deploy-preview-7876--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 1, 2022
@facebook-github-bot
Copy link
Contributor

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

@Josh-Cena Josh-Cena changed the title style(tag): visual center alignment refactor(theme-classic): make tag text visually certered Aug 2, 2022
@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Aug 2, 2022
@Josh-Cena
Copy link
Collaborator

Interesting. I don't like the idea of hacking dimensions just so things appear "visually aligned", because if you use a font with different baseline height then everything is misaligned again. But I'm not master with CSS so I'll defer this to someone else to review.

@slorber
Copy link
Collaborator

slorber commented Aug 9, 2022

Thanks.

I'll merge because it looks better by default and with many fonts.

However, this is not a good generic solution to this problem.

The problem is that fonts have different ascenders/descenders.
Different fonts will give you different results here, and this change may even annoy some Docusaurus users that are using fonts that are already more "balanced".

See for example what the "fantasy" font looks like (no padding change) compared to the original:

CleanShot 2022-08-09 at 19 56 55@2x

This is a good lib to work with ascenders/descenders, or just to understand the problem: https://seek-oss.github.io/capsize/

CleanShot 2022-08-09 at 19 59 08@2x

@slorber slorber merged commit 221b114 into facebook:main Aug 9, 2022
@Kosai106 Kosai106 deleted the patch-1 branch August 10, 2022 10:17
@Kosai106
Copy link
Contributor Author

@slorber absolutely it's not a perfect solution by any means. However it is the simplest and quickest, short term at least.

@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label Aug 12, 2022
@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed to backport This PR is planned to be backported to a stable version of Docusaurus labels Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants