Skip to content

Commit 4515d23

Browse files
authored
Merge pull request #53 from Gebon/scroll
Beautify .note/.legend elements. Add overflow scrolling for code
2 parents db99770 + 9edbe3c commit 4515d23

File tree

2 files changed

+42
-16
lines changed

2 files changed

+42
-16
lines changed

04-code-vectorization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ other distance masks.
774774
.. note::
775775

776776
If we suppose that boids cannot occupy the same position, how can you
777-
compute `mask_0` more efficiently ?
777+
compute `mask_0` more efficiently?
778778

779779
.. code:: python
780780

book.css

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,7 @@ h2.subtitle {
226226

227227

228228
/* --- Math ---------------------------------------------------------------- */
229-
span.formula {
230-
color: #955;
231-
font-family: 'Source Sans Pro', sans-serif;
232-
font-weight: 300;
233-
}
229+
span.formula,
234230
div.formula {
235231
color: #955;
236232
font-family: 'Source Sans Pro', sans-serif;
@@ -243,26 +239,26 @@ code {
243239
font-weight: 300;
244240
font-family: 'Source Code Pro';
245241
}
246-
pre.code {
242+
pre.code,
243+
pre.output {
247244
font-size: 85%;
248245
font-family: 'Source Code Pro', monospace;
249246
line-height: 125%;
250-
background: #fcfcfc;
251-
border-top: .5px solid #ccc;
252-
border-bottom: .5px solid #ccc;
253247
padding-left: 2.0em;
254248
padding-top: 0.5em;
255249
padding-bottom: 0.5em;
250+
overflow-x: auto;
251+
}
252+
pre.code {
253+
254+
background: #fcfcfc;
255+
border-top: .5px solid #ccc;
256+
border-bottom: .5px solid #ccc;
256257
}
257258
pre.output {
258-
font-size: 85%;
259-
font-family: 'Source Code Pro', monospace;
260-
line-height: 125%;
261259
background: #fff;
262260
border: none;
263-
padding-left: 2.0em;
264-
padding-top: 0.5em;
265-
padding-bottom: 0.5em;
261+
266262
}
267263

268264
.function, .class {
@@ -351,3 +347,33 @@ tr:nth-child(even) td {
351347
font-weight: 400;
352348
border-bottom: 1px solid #000;
353349
}
350+
351+
@media all and (max-width: 1400px) {
352+
.note,
353+
.legend {
354+
box-sizing: border-box;
355+
width: 80%;
356+
margin: 10px auto;
357+
float: none;
358+
box-shadow: 0 0 10px rgba(0,0,0,0.5);
359+
border-radius: 5px;
360+
padding: 10px;
361+
}
362+
}
363+
364+
@media all and (max-width: 870px) {
365+
pre.code,
366+
pre.output {
367+
padding-left: 0.5em;
368+
}
369+
370+
body {
371+
font-size: 16px;
372+
}
373+
}
374+
375+
@media all and (max-width: 500px) {
376+
body {
377+
font-size: 14px;
378+
}
379+
}

0 commit comments

Comments
 (0)