Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bugfix: quote monospace font#85

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JulienPalard merged 2 commits intopython:masterfromtusharsadhwani:patch-1
Oct 7, 2021

Conversation

tusharsadhwani
Copy link
Contributor

@tusharsadhwanitusharsadhwani commentedOct 7, 2021
edited
Loading

For some reason, saying justmonospace here doesn't seem to work on chrome mobile. Quoting monospace fixes the issue.

Before:

After:

AlexWaygood reacted with heart emoji
For some reason, saying just `monospace` here doesn't seem to work on chrome mobile. Quoting monospace fixes the issue.
@nedbat
Copy link
Member

Seehttps://twitter.com/sadhlife/status/1446060335979397120 for the sleuthing :)

hugovk reacted with hooray emojitusharsadhwani reacted with heart emoji

@hugovk
Copy link
Member

Good work! As it happens, this is fixed in the upcoming Chrome 96:python/pythondotorg#1708 (comment)

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

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

Despite the upcoming fix in Chrome, this is such a simple fix, I think it's worth merging for people who will still be on Chrome < 96, even after Chrome 96 release.

(Plus for people using latest Chrome 94 now :)

@JulienPalard
Copy link
Member

Oh this kind of bugs … ☹

@JulienPalardJulienPalard merged commit60d013d intopython:masterOct 7, 2021
@JulienPalard
Copy link
Member

Thanks@tusharsadhwani and@nedbat!

hugovk and tusharsadhwani reacted with thumbs up emoji

@JulienPalard
Copy link
Member

I released it as python-docs-theme 2021-11 (I live in the future) and rebuilthttps://docs.python.org/3/ so someone can check. Rebuild for other versions and languages will be automatically done in the next 24h.

@beauremus
Copy link

This "fix" broke the font for me. My Chrome on my Mac is now loading Helvetica for code rather than Courier. I can confirm that removing the quotes frommonospace fixes the issue for me. I recommend this change be reverted and wait for a Chrome mobile fix. Let me know if I need to create a PR.

jstvz and lxnn reacted with thumbs up emoji

@tusharsadhwani
Copy link
ContributorAuthor

Chrome, showing 3 different behaviours on 3 operating systems. A tale as old as time.

@nedbat
Copy link
Member

Perhaps the best fix is to just specify monospace. Why a fallback to sans-serif? Does any browser not have a monospace font that is used when you specify monospace?

@tusharsadhwani
Copy link
ContributorAuthor

Removing the quotes from monospace even with it being the only specified font breaks on current chrome mobile.

@hugovk
Copy link
Member

So... Do we need one monospace with quotes and one monospace without quotes? 🙃

Perhaps the best fix is to just specify monospace. Why a fallback to sans-serif? Does any browser not have a monospace font that is used when you specify monospace?

The problem seems to be desktop isn't picking up the "monospace" and falling back to sans-serif. If we remove sans-serif, it'll fall back to some system default, which will be some sans-serif or serif, but not monospace.

@tusharsadhwani
Copy link
ContributorAuthor

Okay, I tested on 3.9's page, and it seems just

pre {font-family: monospace;}

seems to work. Can someone test it on all 3 platforms, android mac and windows, that'd be great.

@tusharsadhwani
Copy link
ContributorAuthor

Android, Chrome 94

Linux, Chrome 94
image

@arseniiv
Copy link

arseniiv commentedOct 7, 2021
edited
Loading

Noticed my Firefox 93.0 on win10 is weirded by"monospace" and falls back tosans-serif, though it underlines"monospace" in the style inspector as if it was used. Usingfont-family: "monospace", monospace, sans-serif; seems to work fine, though. Would this variant satisfy Chrome?

@brandon-leapyear
Copy link

brandon-leapyear commentedOct 7, 2021
edited
Loading

This is an old work account. Please reference@brandonchinn178 for all future communication


Can confirm, currently fonts ondocs.python.org are NOT monospaced on Chrome.font-family: "monospace", monospace, sans-serif does work.

tusharsadhwani reacted with thumbs up emoji

@tusharsadhwani
Copy link
ContributorAuthor

tusharsadhwani commentedOct 7, 2021
edited
Loading

font-family: "monospace", monospace, sans-serif;

Can confirm, works fine. Even on mobile where justmonospace, sans-serif doesn't.

@hugovk
Copy link
Member

There is (or was) a known problem with plainfont-family: monospace; that can cause text resizing issues, seenecolas/normalize.css#519 (comment). The workaround isfont-family: monospace, monospace; or
font-family: monospace, anyotherfont;`

Andnecolas/normalize.css#519 (comment) suggests a reason, browsers looked for the fixed stringfont-family: monospace;

tusharsadhwani reacted with thumbs up emoji

@tusharsadhwani
Copy link
ContributorAuthor

Ah, that makes sense now. So I guessmonospace, "monospace"; it is then :P

@beauremus
Copy link

beauremus commentedOct 7, 2021
edited
Loading

MacOS Chrome 94monospace
Screen Shot 2021-10-07 at 12 34 04 PM
MacOS Chrome 94monspace, "monospace"
Screen Shot 2021-10-07 at 12 37 52 PM

Both solutions work for me.

@tusharsadhwani
Copy link
ContributorAuthor

@beauremus Thanks a bunch.

beauremus reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugovkhugovkhugovk approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@tusharsadhwani@nedbat@hugovk@JulienPalard@beauremus@arseniiv@brandon-leapyear@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp