Skip to content

Commit f190901

Browse files
committed
modicum of responsiveness
1 parent 8f9a9b2 commit f190901

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The tutorial is under copyright and cannot be republished without my permission.
6969

7070
## TODO
7171

72-
- [] modicum of responsiveness
7372
- [] decade fix -- requires lookahead to make sure decade actually is. Need to backport fix
7473
- [] performance?
7574
- [] final copy edits
75+
- [] title/subtitle styling

Diff for: Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ task :build do
7272
end
7373

7474
# TODO: Figure out a better way to create a layout for a markdown document
75-
compiled = layout.gsub('<body></body>', "<body>#{doc.to_html}#{generated_at_html}</body>")
75+
compiled = layout.gsub('{{CONTENT}}', "#{doc.to_html}#{generated_at_html}")
7676

7777
FileUtils.mkdir_p('build')
7878

Diff for: tutorial/layout.html

+38-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
56
<title></title>
67
<style>
78
body {
89
font-family: Helvetica;
910
font-size: 20px;
1011
line-height: 1.2;
11-
width: 920px;
12+
min-width: 320px;
13+
width: 100%;
14+
margin: 0;
15+
padding: 0;
16+
}
17+
18+
#content {
19+
max-width: 920px;
1220
margin-left: auto;
1321
margin-right: auto;
22+
padding-left: 5px;
23+
padding-right: 5px;
1424
}
1525

1626
code {
@@ -31,19 +41,37 @@
3141
padding-left: 15px;
3242
}
3343

44+
svg {
45+
max-width: 100%;
46+
}
47+
3448
div.aside {
3549
font-size: 80%;
3650
background: aliceblue;
37-
width: 400px;
38-
float: right;
39-
margin-left: 20px;
40-
padding: 20px 20px 0 20px;
51+
padding: 20px 20px 0px 20px;
4152
}
4253

4354
div.aside h3 {
4455
margin: 0;
4556
}
4657

58+
@media screen and (max-width: 600px) {
59+
div.aside {
60+
width: 100%;
61+
box-sizing: border-box;
62+
padding-bottom: 1px;
63+
}
64+
}
65+
66+
@media screen and (min-width: 600px) {
67+
div.aside {
68+
min-width: 300px;
69+
max-width: 400px;
70+
float: right;
71+
margin-left: 20px;
72+
}
73+
}
74+
4775
span.query-string {
4876
background: aliceblue;
4977
font-family: "Source Code Pro", Consolas, Monaco, monospace;
@@ -59,6 +87,10 @@
5987
color: #999;
6088
}
6189

90+
pre {
91+
overflow: auto;
92+
}
93+
6294
.highlight table td { padding: 5px; }
6395
.highlight table pre { margin: 0; }
6496
.highlight .cm {
@@ -306,5 +338,5 @@
306338
}
307339
</style>
308340
</head>
309-
<body></body>
341+
<body><div id="content">{{CONTENT}}</div></body>
310342
</html>

0 commit comments

Comments
 (0)