Skip to content

Commit cb86c29

Browse files
authored
Use flexbox for API docs layout (#549)
1 parent ba8571b commit cb86c29

File tree

1 file changed

+47
-37
lines changed

1 file changed

+47
-37
lines changed

docs/source/_static/nature_custom.css_t

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -35,56 +35,63 @@
3535
*/
3636

3737
@import url("basic.css");
38-
38+
3939
/* -- page layout ----------------------------------------------------------- */
40-
40+
4141
body {
4242
font-family: Arial, sans-serif;
4343
font-size: 100%;
4444
background-color: #fff;
4545
color: #555;
4646
margin: 0;
4747
padding: 0;
48+
min-width: 600px; /* new */
4849
}
4950

5051
div.documentwrapper {
51-
float: left;
52-
width: 100%;
52+
/* float: left; */
53+
/* width: 100%; */
54+
min-width: 450px; /* new */
55+
flex: 600px 9999 1; /* new */
5356
}
5457

5558
div.bodywrapper {
56-
margin: 0 0 0 400px !important;
57-
/*margin: 0 0 0 {{ theme_sidebarwidth|todim }};*/
59+
/* margin: 0 0 0 {{ theme_sidebarwidth|todim }}; */
5860
}
5961

6062
hr {
6163
border: 1px solid #B1B4B6;
6264
}
63-
65+
6466
div.document {
6567
background-color: #eee;
68+
display: flex; /* new */
69+
flex-direction: row-reverse; /* new */
70+
align-items: stretch; /* new */
71+
flex-wrap: wrap-reverse; /* new */
72+
justify-content: flex-end; /* new */
6673
}
67-
74+
6875
div.body {
6976
background-color: #ffffff;
7077
color: #3E4349;
7178
padding: 0 30px 30px 30px;
7279
font-size: 0.9em;
7380
}
74-
81+
7582
div.footer {
7683
color: #555;
7784
width: 100%;
7885
padding: 13px 0;
7986
text-align: center;
8087
font-size: 75%;
8188
}
82-
89+
8390
div.footer a {
8491
color: #444;
8592
text-decoration: underline;
8693
}
87-
94+
8895
div.related {
8996
background-color: #000000;
9097
/*background-color: #6BA81E;*/
@@ -94,22 +101,25 @@ div.related {
94101
/*text-shadow: 0px 1px 0 #444;*/
95102
font-size: 0.9em;
96103
}
97-
104+
98105
div.related a {
99106
color: #ffffff;
100107
/*color: #E2F3CC;*/
101108
}
102-
109+
103110
div.sphinxsidebar {
104-
width: 400px !important; /* new */
111+
flex: {{ theme_sidebarwidth|todim }}; /* new */
105112
font-size: 0.75em;
106113
line-height: 1.5em;
114+
float: initial; /* new */
115+
width: unset; /* new */
116+
margin-left: 0; /* new */
107117
}
108118

109119
div.sphinxsidebarwrapper{
110120
padding: 20px 0;
111121
}
112-
122+
113123
div.sphinxsidebar h3,
114124
div.sphinxsidebar h4 {
115125
font-family: Arial, sans-serif;
@@ -128,30 +138,30 @@ div.sphinxsidebar h4 {
128138
div.sphinxsidebar h4{
129139
font-size: 1.1em;
130140
}
131-
141+
132142
div.sphinxsidebar h3 a {
133143
color: #444;
134144
}
135-
136-
145+
146+
137147
div.sphinxsidebar p {
138148
color: #888;
139149
padding: 5px 20px;
140150
}
141-
151+
142152
div.sphinxsidebar p.topless {
143153
}
144-
154+
145155
div.sphinxsidebar ul {
146156
margin: 10px 20px;
147157
padding: 0;
148158
color: #000;
149159
}
150-
160+
151161
div.sphinxsidebar a {
152162
color: #444;
153163
}
154-
164+
155165
div.sphinxsidebar input {
156166
border: 1px solid #ccc;
157167
font-family: sans-serif;
@@ -164,17 +174,17 @@ div.sphinxsidebar .searchformwrapper {
164174
}
165175

166176
/* -- body styles ----------------------------------------------------------- */
167-
177+
168178
a {
169179
color: #005B81;
170180
text-decoration: none;
171181
}
172-
182+
173183
a:hover {
174184
color: #E32E00;
175185
text-decoration: underline;
176186
}
177-
187+
178188
div.body h1,
179189
div.body h2,
180190
div.body h3,
@@ -191,30 +201,30 @@ div.body h6 {
191201
text-shadow: none;
192202
/*text-shadow: 0px 1px 0 white;*/
193203
}
194-
204+
195205
div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; }
196206
div.body h2 { font-size: 150%; background-color: #a9d3ff; }
197207
div.body h3 { font-size: 120%; background-color: #a9d3ff; }
198208
div.body h4 { font-size: 110%; background-color: #a9d3ff; }
199209
div.body h5 { font-size: 100%; background-color: #a9d3ff; }
200210
div.body h6 { font-size: 100%; background-color: #a9d3ff; }
201-
211+
202212
a.headerlink {
203213
color: #c60f0f;
204214
font-size: 0.8em;
205215
padding: 0 4px 0 4px;
206216
text-decoration: none;
207217
}
208-
218+
209219
a.headerlink:hover {
210220
background-color: #c60f0f;
211221
color: white;
212222
}
213-
223+
214224
div.body p, div.body dd, div.body li {
215225
line-height: 1.5em;
216226
}
217-
227+
218228
div.admonition p.admonition-title + p {
219229
display: inline;
220230
}
@@ -227,16 +237,16 @@ div.note {
227237
background-color: #eee;
228238
border: 1px solid #ccc;
229239
}
230-
240+
231241
div.seealso {
232242
background-color: #ffc;
233243
border: 1px solid #ff6;
234244
}
235-
245+
236246
div.topic {
237247
background-color: #eee;
238248
}
239-
249+
240250
div.warning {
241251
background-color: #ffe4e4;
242252
border: 1px solid #f66;
@@ -250,11 +260,11 @@ div.note {
250260
p.admonition-title {
251261
display: inline;
252262
}
253-
263+
254264
p.admonition-title:after {
255265
content: ":";
256266
}
257-
267+
258268
pre {
259269
padding: 10px;
260270
background-color: #f0f0f0;
@@ -268,7 +278,7 @@ pre {
268278
/*-webkit-box-shadow: 1px 1px 1px #d8d8d8;*/
269279
/*-moz-box-shadow: 1px 1px 1px #d8d8d8;*/
270280
}
271-
281+
272282
code {
273283
background-color: #ecf0f3;
274284
color: #222;
@@ -300,4 +310,4 @@ li > p:first-child {
300310

301311
li > p:last-child {
302312
margin-top: 10px;
303-
}
313+
}

0 commit comments

Comments
 (0)