Skip to content

Commit d955a6a

Browse files
Move theme picker to the right with the other buttons
1 parent 8c9c796 commit d955a6a

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

src/librustdoc/html/static/css/rustdoc.css

+12-8
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,13 @@ nav.main .separator {
791791
margin: 0 20px;
792792
}
793793
nav.sum { text-align: right; }
794-
nav.sub form { display: inline; }
794+
nav.sub form {
795+
flex-grow: 1;
796+
}
797+
798+
nav.sub form input {
799+
height: 100%;
800+
}
795801

796802
a {
797803
text-decoration: none;
@@ -883,6 +889,7 @@ table,
883889
position: relative;
884890
display: flex;
885891
height: 34px;
892+
width: 100%;
886893
}
887894
.search-container > * {
888895
height: 100%;
@@ -1379,16 +1386,13 @@ pre.rust {
13791386
}
13801387

13811388
.theme-picker {
1382-
position: absolute;
1383-
left: -38px;
1384-
top: 4px;
1389+
position: relative;
13851390
}
1386-
13871391
.theme-picker button {
13881392
outline: none;
13891393
}
13901394

1391-
#settings-menu, #help-button {
1395+
#settings-menu, #help-button, .theme-picker {
13921396
margin-left: 4px;
13931397
outline: none;
13941398
}
@@ -1425,7 +1429,7 @@ pre.rust {
14251429
display: none;
14261430
position: absolute;
14271431
left: 0;
1428-
top: 28px;
1432+
top: 31px;
14291433
border: 1px solid;
14301434
border-radius: 3px;
14311435
z-index: 1;
@@ -1832,7 +1836,7 @@ details.rustdoc-toggle[open] > summary.hideme::after {
18321836
}
18331837

18341838
/* Space is at a premium on mobile, so remove the theme-picker icon. */
1835-
#theme-picker {
1839+
.theme-picker {
18361840
display: none;
18371841
width: 0;
18381842
}

src/librustdoc/html/templates/page.html

+15-15
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,8 @@ <h2 class="location"></h2>
108108
{%- endif -%}
109109
</a> {#- -#}
110110
<nav class="sub"> {#- -#}
111-
<div class="theme-picker"> {#- -#}
112-
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
113-
<img width="22" height="22" alt="Pick another theme!" {# -#}
114-
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
115-
</button> {#- -#}
116-
<div id="theme-choices" role="menu"></div> {#- -#}
117-
</div> {#- -#}
118-
<form class="search-form"> {#- -#}
119-
<div class="search-container"> {#- -#}
111+
<div class="search-container"> {#- -#}
112+
<form class="search-form"> {#- -#}
120113
<span></span> {#- This empty span is a hacky fix for Safari - See #93184 -#}
121114
<input {# -#}
122115
class="search-input" {# -#}
@@ -125,13 +118,20 @@ <h2 class="location"></h2>
125118
spellcheck="false" {# -#}
126119
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
127120
type="search"> {#- -#}
128-
<button type="button" id="help-button" title="help">?</button> {#- -#}
129-
<a id="settings-menu" href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
130-
<img width="22" height="22" alt="Change settings" {# -#}
131-
src="{{static_root_path|safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
132-
</a> {#- -#}
121+
</form> {#- -#}
122+
<button type="button" id="help-button" title="help">?</button> {#- -#}
123+
<div class="theme-picker"> {#- -#}
124+
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
125+
<img width="22" height="22" alt="Pick another theme!" {# -#}
126+
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
127+
</button> {#- -#}
128+
<div id="theme-choices" role="menu"></div> {#- -#}
133129
</div> {#- -#}
134-
</form> {#- -#}
130+
<a id="settings-menu" href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
131+
<img width="22" height="22" alt="Change settings" {# -#}
132+
src="{{static_root_path|safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
133+
</a> {#- -#}
134+
</div> {#- -#}
135135
</nav> {#- -#}
136136
</div> {#- -#}
137137
<section id="main-content" class="content">{{- content|safe -}}</section> {#- -#}

0 commit comments

Comments
 (0)