Skip to content

Commit 9b75889

Browse files
committed
Update dark theme to work with mobile style
1 parent 3bf3806 commit 9b75889

File tree

3 files changed

+17
-67
lines changed

3 files changed

+17
-67
lines changed

python_docs_theme/layout.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ <h3>{{ _('Navigation') }}</h3>
5959

6060
{%- macro themeselector() %}
6161
<label class="theme-selector-label">
62-
{{ _('Color theme') }}
62+
{{ _('Theme') }}
6363
<select class="theme-selector" oninput="activateTheme(this.value)">
64-
<option value="auto" selected>{{ _('Auto (default)') }}</option>
65-
<option value="light">{{ _('Light theme') }}</option>
66-
<option value="dark">{{ _('Dark theme') }}</option>
64+
<option value="auto" selected>{{ _('Auto') }}</option>
65+
<option value="light">{{ _('Light') }}</option>
66+
<option value="dark">{{ _('Dark') }}</option>
6767
</select>
6868
</label>
6969
{%- endmacro %}

python_docs_theme/static/pydoctheme.css

+11-57
Original file line numberDiff line numberDiff line change
@@ -324,19 +324,19 @@ dl > dt span ~ em {
324324
z-index: 1;
325325
height: 40px;
326326
width: 100%;
327-
max-width: 100vw;
328-
padding: 0 1rem 0 45px;
329327
display: flex;
330328
background-color: white;
331329
}
332330
.nav-items-wrapper {
333331
display: flex;
334332
flex: auto;
335-
padding: .5rem;
333+
padding: .25rem;
334+
align-items: stretch;
336335
}
337336
.nav-logo {
338337
margin-right: 1rem;
339338
flex-shrink: 0;
339+
align-self: center;
340340
}
341341
.nav-content img {
342342
display: block;
@@ -352,64 +352,47 @@ dl > dt span ~ em {
352352
display: flex;
353353
flex: auto;
354354
border: 1px solid #a9a9a9;
355-
}
356-
.nav-content .search:hover {
357-
box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28);
358-
border-color: rgba(223,225,229,0);
355+
align-items: stretch;
359356
}
360357
.nav-content .search input[type=search] {
361358
border: 0;
362-
outline: 0;
363-
padding-left: 20px;
359+
padding-left: 24px;
364360
flex: 1;
365361
}
366362
.nav-content .search input[type=submit] {
367363
height: 100%;
368-
appearance: none;
369-
-webkit-appearance: none;
370364
box-shadow: none;
371365
border: 0;
372-
outline: 1px solid #999;
366+
border-left: 1px solid #a9a9a9;
373367
cursor: pointer;
374-
background-color: #f0f0f0;
375368
margin-right: 0;
376369
}
377-
.nav-content .search input[type=submit]:hover {
378-
border-color: #a9a9a9;
379-
}
380370
.nav-content .search svg {
381371
position: absolute;
372+
align-self: center;
373+
padding-left: 4px;
382374
}
383375
.toggler__input {
384376
display: none;
385377
}
386378
.toggler__label {
387379
width: 40px;
388380
cursor: pointer;
389-
background-color: transparent;
390-
border: 1px solid white;
391381
display: flex;
392382
align-items: center;
393383
justify-content: center;
394384
padding: 8px;
395385
flex-shrink: 0;
396386
}
397-
.toggler__label:focus {
398-
background-color: #eee;
399-
border: 1px solid #ededed;
400-
box-shadow: rgba(0, 0, 0, 0.25) 1px 0 2px 0;
401-
}
402-
.toggler__label:hover {
403-
background-color: #eee;
404-
border: 1px solid #ededed;
405-
box-shadow: rgba(0, 0, 0, 0.25) 1px 0 2px 0;
387+
.toggler__label:hover, .toggler__label:focus {
388+
background-color: rgba(127 127 127 / 50%);
406389
}
407390
.toggler__label > span {
408391
position: relative;
409392
flex: none;
410393
height: 2px;
411394
width: 100%;
412-
background: #444;
395+
background: currentColor;
413396
transition: all 400ms ease;
414397
}
415398
.toggler__label > span::before,
@@ -496,38 +479,9 @@ dl > dt span ~ em {
496479
.menu ul li {
497480
margin-bottom: 0.5rem;
498481
}
499-
.language_switcher_placeholder,
500-
.version_switcher_placeholder {
501-
position: relative;
502-
border: 1px solid #a8a8a8;
503-
height: 30px;
504-
padding-right: 7px;
505-
}
506482
.language_switcher_placeholder {
507483
margin-top: 2rem;
508484
}
509-
.language_switcher_placeholder::after,
510-
.version_switcher_placeholder::after {
511-
content: url('../_static/caret-down.svg');
512-
position: absolute;
513-
top: 7px;
514-
width: 15px;
515-
height: 15px;
516-
right: 0;
517-
pointer-events: none;
518-
}
519-
.language_switcher_placeholder select,
520-
.version_switcher_placeholder select {
521-
-webkit-appearance: none;
522-
appearance: none;
523-
border: 0;
524-
height: 100%;
525-
background-color: white;
526-
}
527-
.language_switcher_placeholder:focus-visible,
528-
.version_switcher_placeholder:focus-visible {
529-
outline-offset: 5px;
530-
}
531485
.language_switcher_placeholder select {
532486
width: 100%;
533487
}

python_docs_theme/static/pydoctheme_dark.css

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Browser elements */
33
:root {
44
scrollbar-color: #616161 transparent;
5-
color-scheme: dark light;
5+
color-scheme: dark;
66
}
77

88
html,
@@ -28,7 +28,7 @@ div.sphinxsidebar, .menu-wrapper {
2828
color: inherit !important;
2929
}
3030

31-
div.sidebar {
31+
div.sidebar, aside.sidebar {
3232
background-color: #424242;
3333
border-color: #616161;
3434
}
@@ -120,7 +120,3 @@ div.note {
120120
.nav-content {
121121
background-color: black;
122122
}
123-
124-
.nav-content .search svg {
125-
color: black;
126-
}

0 commit comments

Comments
 (0)