docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

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

Open Kosai106 opened this issue 2 years ago • 7 comments

Pre-flight checklist

  • [x] 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

Kosai106 avatar Aug 01 '22 13:08 Kosai106

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 [email protected]. Thanks!

facebook-github-bot avatar Aug 01 '22 13:08 facebook-github-bot

[V2]

Built without sensitive environment variables

Name Link
Latest commit 3bffc92c41425888763ed318475262ac94cee201
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.

netlify[bot] avatar Aug 01 '22 13:08 netlify[bot]

⚡️ 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

github-actions[bot] avatar Aug 01 '22 13:08 github-actions[bot]

[V2]

Built without sensitive environment variables

Name Link
Latest commit 358d4b492c040e25b7e30e15ff758f99c504eb46
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.

netlify[bot] avatar Aug 01 '22 13:08 netlify[bot]

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 avatar Aug 01 '22 14:08 facebook-github-bot

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 avatar Aug 01 '22 14:08 facebook-github-bot

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.

Josh-Cena avatar Aug 02 '22 17:08 Josh-Cena

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 avatar Aug 09 '22 17:08 slorber

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

Kosai106 avatar Aug 10 '22 13:08 Kosai106