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

Prepend monospace font stack with new ui-monospace font family #1219

Merged
merged 3 commits into from
May 26, 2021
Merged

Prepend monospace font stack with new ui-monospace font family #1219

merged 3 commits into from
May 26, 2021

Conversation

lunacookies
Copy link
Contributor

Prior to this PR the monospace font stack used SFMono-Regular, which would only work when the user had both manually installed SF Mono and was using Chrome. With this PR, the browser will choose the system font’s monospace variant, given that the browser actually supports ui-monospace. Browser support is, as of this PR, limited to Safari. It can’t hurt to add, though. Support will hopefully expand to other browsers as ui-monospace is part of the CSS Fonts Module Level 4 Draft.

/cc @primer/ds-core

This selects the system font’s monospace variant, given browser support.
@vercel
Copy link

vercel bot commented Jan 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-css/ldzbf4eh0
✅ Preview: https://primer-css-git-fork-arzg-ui-monospace.primer.vercel.app

@vercel vercel bot temporarily deployed to Preview January 22, 2021 08:56 Inactive
@simurai simurai added this to 🔍 Ready to release in 📦 Primer CSS release tracking via automation Jan 25, 2021
Base automatically changed from master to main March 26, 2021 00:50
@simurai
Copy link
Contributor

simurai commented Apr 8, 2021

👋 Just a quick note once we look into this again.

In Slack we got notified that the current .text-mono font is not vertically aligned compared to other things like buttons:

Screen Shot 2021-04-07 at 16 36 18

Here a test in isolation https://codepen.io/simurai/pen/04b6aa50642b27ec59acf2fe6b5bb980 and it seems that a lot of monospace fonts are rendered too high compared to the element's height.

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2021

⚠️ No Changeset found

Latest commit: 0a278f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@simurai simurai changed the base branch from main to mono-font May 26, 2021 02:35
@simurai
Copy link
Contributor

simurai commented May 26, 2021

There is another request to add ui-monospace: refined-github/refined-github#4398.

So maybe we can combine this PR with #992.

@simurai simurai merged commit 1502641 into primer:mono-font May 26, 2021
📦 Primer CSS release tracking automation moved this from 🔍 Ready to release to 💜 Done May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants