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

Fix the appearance of version/language selects #74

Merged
merged 4 commits into from
May 12, 2021

Conversation

obulat
Copy link
Contributor

@obulat obulat commented May 9, 2021

This PR fixes several issues in the appearance of version and language selects in Safari and Android Chrome.

On narrow screens, the theme overrides the native appearance of selects to make them look the same in all browsers. However, the non-prefixed appearance: none doesn't work in Safari and Chrome for Android, so I added the -webkit prefix.

I also added right padding to the version switcher to fix the overlapping of the arrow and the version number when the version number is long.

When clicking the select or focusing on it using tab, user can see an outline. Currently, it goes around the select itself, not the outer div, and looks like it's inside the box. I added the outline-offset to fix this.

The appearance:none needs a -webkit prefix to work in Safari and Chrome on Android.
Adding padding to the select's outer div fixes arrow overlapping with the select's value.
Adding outline offset for focus-visible makes the outline go around the border instead of within it (just around the inner select itself).
@obulat
Copy link
Contributor Author

obulat commented May 9, 2021

On some mobile screens, the top search form was overflowing. I fixed it by adding max-width to the navbar. This happens on pages with long method names in the body that are inside paragraphs and cannot be split, which makes the window wider than 100%.

The default paddings and margins for lists and blockquotes look good on desktop, but make the readable part of the screen too narrow on mobile, I made them narrower.

@JulienPalard
Copy link
Member

JulienPalard commented May 9, 2021

I deployed this fix on https://docs.python.org/3.11/ (english only, but other languages will automatically follow in the next 24 hours) so it can easily be reviewed.

@obulat
Copy link
Contributor Author

obulat commented May 9, 2021

I deployed this fix on https://docs.python.org/3.11/ (english only, but other languages will automatically follow in the next 24 hours) so it can easily be reviewed.

Thank you! I will need to fix that gray background on the switchers. It isn't there when I test in devtools q

Some problems in Safari mobile browser were fixed: right margin on the search box (between the button and the border), color of the button;
Language and version switchers in both Chrome for Android and Safari had gray background.
@obulat
Copy link
Contributor Author

obulat commented May 11, 2021

@JulienPalard, could you deploy the latest version? I would like to see if the background color on the selects is fixed.

@JulienPalard
Copy link
Member

For the record (also using the PR comment as an extension of my own memory), here's what it take to rebuild in production:

docsbuild@docs:~$ /srv/docsbuild/venv-with-sphinx-3.2.1/bin/python -m pip install --upgrade git+https://github.com/obulat/python-docs-theme@patch-1
docsbuild@docs:~$ /srv/docsbuild/venv/bin/python /srv/docsbuild/scripts/build_docs.py --quick --language en --branch 3.10

@obulat rebuild done for 3.10 only, english only.

@obulat
Copy link
Contributor Author

obulat commented May 11, 2021

Thank you, @JulienPalard ! I fixed a silly button border error, and now the gray switchers background on Chrome on Android is fixed. I don't have an iphone to test the site in Safari, though.

@JulienPalard
Copy link
Member

JulienPalard commented May 11, 2021

I'm building it again on docs.python.org/3.10/

[building ...]

build complete.

@JulienPalard
Copy link
Member

JulienPalard commented May 11, 2021

On docs.python.org/3.10 on my phone I'm getting a css issue:
2021-05-11 11 25 40
I don't know how to debug this in mobile but it may be the same as #78

I do not have the issue on my desktop though, which is properly sending validation requests like:

GET /3.10/_static/pydoctheme.css HTTP/1.1
Host: docs.python.org
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0
Accept: text/css,*/*;q=0.1
Accept-Language: fr,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
DNT: 1
Connection: keep-alive
Referer: https://docs.python.org/3.10/
If-Modified-Since: Tue, 11 May 2021 08:22:33 GMT
If-None-Match: "609a3ec9-285c"

@JulienPalard JulienPalard merged commit 053ee9a into python:master May 12, 2021
@JulienPalard
Copy link
Member

Thanks \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants