From 87f9f410b81bed97e4356a18d366eb800f8747b9 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Sun, 9 May 2021 07:55:01 +0300 Subject: [PATCH 1/4] Fix the appearance of version/language selects 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). --- python_docs_theme/static/pydoctheme.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index be98ed3..08d4a62 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -454,6 +454,7 @@ dl > dt span ~ em { position: relative; border: 1px solid #a8a8a8; height: 30px; + padding-right: 7px; } .language_switcher_placeholder { margin-top: 2rem; @@ -465,15 +466,20 @@ dl > dt span ~ em { top: 7px; width: 15px; height: 15px; - right: 3px; + right: 0; pointer-events: none; } .language_switcher_placeholder select, .version_switcher_placeholder select { + -webkit-appearance: none; appearance: none; border: 0; height: 100%; } + .language_switcher_placeholder:focus-visible, + .version_switcher_placeholder:focus-visible { + outline-offset: 5px; + } .language_switcher_placeholder select { width: 100%; } From a49d94eafb19e7224ab043c7b76293e405e3e0b0 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Sun, 9 May 2021 08:58:44 +0300 Subject: [PATCH 2/4] Fix search form overflow; readability improvements --- python_docs_theme/static/pydoctheme.css | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 08d4a62..0d9d38b 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -235,6 +235,14 @@ dl > dt span ~ em { div.body h3, div.body h4, div.body h5 { font-size: 1rem; } + /* Override default styles to make more readable */ + div.body ul { + padding-inline-start: 1rem; + } + div.body blockquote { + margin-inline-start: 1rem; + margin-inline-end: 0; + } /* Remove sidebar and top related bar */ div.related, .sphinxsidebar { display: none; @@ -266,6 +274,7 @@ dl > dt span ~ em { top: 0; height: 40px; width: 100%; + max-width: 100vw; padding: 0 1rem 0 45px; display: flex; align-items: center; @@ -285,7 +294,6 @@ dl > dt span ~ em { margin-right: 1rem; } .version_switcher_placeholder select { - height: 30px; border-radius: 0; } .nav-content .search { From c0c7ba3f31c56fe244d179591c8becc8f9ecf161 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Mon, 10 May 2021 08:43:00 +0300 Subject: [PATCH 3/4] Fix search box and select appearances 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. --- python_docs_theme/static/pydoctheme.css | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 0d9d38b..626df88 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -293,9 +293,6 @@ dl > dt span ~ em { flex: 0 1 0; margin-right: 1rem; } - .version_switcher_placeholder select { - border-radius: 0; - } .nav-content .search { display: flex; flex: 1 1 auto; @@ -319,10 +316,17 @@ dl > dt span ~ em { } .nav-content .search input[type=submit] { height: 100%; - border: 0; + appearance: none; + -webkit-appearance: none; + border: 1px solid-transparent; + border-left-color: #a9a9a9; box-shadow: none; - outline: 1px solid #999; cursor: pointer; + background-color: #f0f0f0; + margin-right: 0; + } + .nav-content .search input[type=submit]:hover { + border-color: #a9a9a9; } .nav-content .search svg { flex: 0 0 20px; @@ -483,6 +487,7 @@ dl > dt span ~ em { appearance: none; border: 0; height: 100%; + background-color: white; } .language_switcher_placeholder:focus-visible, .version_switcher_placeholder:focus-visible { From d6e73ccd76edec9242d0fb0cf54890fb3a4071b3 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Tue, 11 May 2021 11:17:17 +0300 Subject: [PATCH 4/4] Fix search button border --- python_docs_theme/static/pydoctheme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 626df88..d3cd2da 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -318,7 +318,7 @@ dl > dt span ~ em { height: 100%; appearance: none; -webkit-appearance: none; - border: 1px solid-transparent; + border: 1px solid transparent; border-left-color: #a9a9a9; box-shadow: none; cursor: pointer;