Skip to content

Commit 053ee9a

Browse files
authored
Fix the appearance of version/language selects (#74)
* 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). * Fix search form overflow; readability improvements * 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. * Fix search button border
1 parent b77519b commit 053ee9a

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

python_docs_theme/static/pydoctheme.css

+26-7
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ dl > dt span ~ em {
235235
div.body h3, div.body h4, div.body h5 {
236236
font-size: 1rem;
237237
}
238+
/* Override default styles to make more readable */
239+
div.body ul {
240+
padding-inline-start: 1rem;
241+
}
242+
div.body blockquote {
243+
margin-inline-start: 1rem;
244+
margin-inline-end: 0;
245+
}
238246
/* Remove sidebar and top related bar */
239247
div.related, .sphinxsidebar {
240248
display: none;
@@ -266,6 +274,7 @@ dl > dt span ~ em {
266274
top: 0;
267275
height: 40px;
268276
width: 100%;
277+
max-width: 100vw;
269278
padding: 0 1rem 0 45px;
270279
display: flex;
271280
align-items: center;
@@ -284,10 +293,6 @@ dl > dt span ~ em {
284293
flex: 0 1 0;
285294
margin-right: 1rem;
286295
}
287-
.version_switcher_placeholder select {
288-
height: 30px;
289-
border-radius: 0;
290-
}
291296
.nav-content .search {
292297
display: flex;
293298
flex: 1 1 auto;
@@ -311,10 +316,17 @@ dl > dt span ~ em {
311316
}
312317
.nav-content .search input[type=submit] {
313318
height: 100%;
314-
border: 0;
319+
appearance: none;
320+
-webkit-appearance: none;
321+
border: 1px solid transparent;
322+
border-left-color: #a9a9a9;
315323
box-shadow: none;
316-
outline: 1px solid #999;
317324
cursor: pointer;
325+
background-color: #f0f0f0;
326+
margin-right: 0;
327+
}
328+
.nav-content .search input[type=submit]:hover {
329+
border-color: #a9a9a9;
318330
}
319331
.nav-content .search svg {
320332
flex: 0 0 20px;
@@ -454,6 +466,7 @@ dl > dt span ~ em {
454466
position: relative;
455467
border: 1px solid #a8a8a8;
456468
height: 30px;
469+
padding-right: 7px;
457470
}
458471
.language_switcher_placeholder {
459472
margin-top: 2rem;
@@ -465,14 +478,20 @@ dl > dt span ~ em {
465478
top: 7px;
466479
width: 15px;
467480
height: 15px;
468-
right: 3px;
481+
right: 0;
469482
pointer-events: none;
470483
}
471484
.language_switcher_placeholder select,
472485
.version_switcher_placeholder select {
486+
-webkit-appearance: none;
473487
appearance: none;
474488
border: 0;
475489
height: 100%;
490+
background-color: white;
491+
}
492+
.language_switcher_placeholder:focus-visible,
493+
.version_switcher_placeholder:focus-visible {
494+
outline-offset: 5px;
476495
}
477496
.language_switcher_placeholder select {
478497
width: 100%;

0 commit comments

Comments
 (0)