Skip to content

Commit cdef9d6

Browse files
committed
Simplified design, moved TOC to sidebar
* Easier navigation with TOC on sidebar * Removed hanging borders throughout * Improved styling to have more consistent sizes across screens * Made body layout fluuuuuuid * BigCheckbox now leans more towards the medium side of the spectrum
1 parent 78a44e5 commit cdef9d6

File tree

7 files changed

+123
-57
lines changed

7 files changed

+123
-57
lines changed

lib/big_checkbox.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,32 @@ class BigCheckbox < Erector::Widget
44
# needs :size => "48px" # todo
55

66
external :style, scss(<<-CSS)
7-
$big_checkbox_size: 48px;
7+
$big_checkbox_size: 20px;
88
99
input.big_checkbox[type=checkbox] {
1010
display:none;
1111
+ label {
1212
height: $big_checkbox_size;
1313
width: $big_checkbox_size;
1414
display:inline-block;
15-
padding: 0 0 0 0px;
16-
margin: 0 4px -8px 0;
15+
padding: 2px;
16+
margin: 0 12px -8px 0;
1717
background-color: white;
1818
z-index: 2;
19-
border: 4px solid #dadada;
20-
@include border-radius(10px);
19+
border: 2px solid #dadada;
2120
}
2221
2322
+ label:hover {
2423
background-image: url(/img/check-dim.png);
24+
background-size: cover;
2525
cursor: pointer;
2626
}
2727
}
2828
2929
input.big_checkbox[type=checkbox]:checked {
3030
+ label {
3131
background-image: url(/img/check.png);
32+
background-size: cover;
3233
}
3334
}
3435
CSS

lib/contents.rb

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def toc_list toc_items
159159

160160
def content
161161
div id: "table_of_contents", class: "toc" do
162-
h1 "Contents"
163162
toc_list hierarchy
164163

165164
unless orphans.empty?

lib/doc_page.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def page_title
7878
class TopLink < Erector::Widget
7979
needs :name, :href, :onclick => nil
8080
def content
81-
a "[#{@name}]", :class => "top_link", :href => @href, :onclick => @onclick
81+
a "#{@name}", :class => "top_link", :href => @href, :onclick => @onclick
8282
end
8383
end
8484

@@ -96,7 +96,6 @@ def top_links
9696
[
9797
TopLink.new(:name => "sites", :href => "#", :onclick => "$('#site_index').toggle(); return false;"),
9898
TopLink.new(:name => "src", :href => "#{file_name.split('.').first}/src"),
99-
TopLink.new(:name => "toc", :href => "#", :onclick => "$('#table_of_contents').toggle(); return false;"),
10099
TopLink.new(:name => "git", :href => git_url),
101100
]
102101
end

lib/step.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def step name = nil, options = {}
9090
div :class => "step", :title => name do
9191
h1 do
9292
widget BigCheckbox
93-
prefix "Step #{num}: "
93+
prefix "Step #{num}" + (!name.nil? ? ': ' : '')
9494
text name
9595
end
9696
_render_inner_content &Proc.new if block_given?

public/css/doc_page.css

+85-25
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ body {
55
}
66

77
h1 {
8-
font-size: 2em;
8+
font-size: 1.5em;
99
-webkit-margin-before: 0;
1010
-webkit-margin-after: 0;
1111
-webkit-margin-start: 0;
@@ -15,79 +15,112 @@ h1 {
1515
.top {
1616
margin-bottom: 1em;
1717
padding: 2px 6px;
18+
background-color: black;
1819
}
20+
1921
.top h1 {
20-
font-size: 2.5em;
21-
font-weight: 800;
22+
padding: 0.5em 0em 0.5em 1.4em;
23+
font-size: 1.4em;
24+
font-weight: normal;
25+
color: white;
2226
}
27+
2328
.top a {
2429
text-decoration: none;
30+
color: white;
2531
}
32+
2633
.top a:visited {
27-
color: black;
34+
color: white;
2835
}
2936

3037
.bottom {
3138
min-height: 60px;
3239
text-align: center;
33-
border-top: 1px solid #333;
40+
border-top: 1px solid #ccc;
41+
font-size: 0.8em;
3442
}
3543

3644
/* toc = Table of Contents */
3745

3846
.toc {
39-
background: #e2f2f2;
4047
padding: 0 0 1em 0;
4148
margin: 0 0 1em 1em;
42-
border: 1px solid blue;
43-
float: right;
4449
width: 26em;
45-
overflow-x: hidden;
46-
display: none;
4750
/* if the toc isn't "positioned", images will show on top of it */
4851
position: relative;
4952
}
5053

54+
#table_of_contents {
55+
float: left;
56+
width: 17em;
57+
}
58+
#table_of_contents h1 {
59+
font-size: 0.9em;
60+
}
61+
62+
#site_index {
63+
float: right;
64+
display: none;
65+
position: absolute;
66+
right: 0px;
67+
top: 55px;
68+
z-index: 2;
69+
background-color: white;
70+
border: 1px solid grey;
71+
}
72+
5173
.toc h1 {
52-
border-bottom: 1px solid blue;
5374
padding-left: 12px;
5475
}
5576

5677
.toc ul {
57-
margin-left: 12px;
58-
padding-left: 12px;
78+
margin-left: 20px;
79+
padding-left: 0px;
80+
list-style-type: none;
5981
}
6082

6183
.toc li a {
6284
font-size: 11pt;
6385
padding: 1px 2px;
64-
border: 1px solid #e2f2f2;
86+
/*border: 1px solid #e2f2f2;*/
6587
text-decoration: none;
88+
6689
display: block; /* fill the entire containing li */
6790
}
6891

6992
.toc li a:hover {
70-
background: #a2aBFD;
7193
border-color: blue;
7294
cursor: pointer;
73-
font-weight: bold;
95+
text-decoration: underline;
7496
}
7597

7698
.toc .current {
7799
font-weight: bold;
78100
padding: 1px 2px
79101
}
80102

103+
.toc ul:not(:first-child) {
104+
border-left: 2px solid #eee;
105+
margin-left: 3px;
106+
padding-left: 6px;
107+
list-style-type: circle;
108+
list-style-position: inside;
109+
}
110+
81111
/**/
82112

83113
.main {
84-
padding-left: 4em;
114+
position: relative;
115+
margin-left: 300px;
116+
margin-right: 20px;
117+
position: relative;
85118
}
119+
86120
.main h1.doc_title {
87-
background: #e2e2f2;
88-
padding: .5em .5em .25em;
89-
margin-bottom: .25em;
90-
margin-left: -2em;
121+
margin-bottom: 1em;
122+
padding-bottom: .25em;
123+
border-bottom: 1px solid #ccc;
91124
}
92125

93126
.doc {
@@ -107,9 +140,15 @@ h1 {
107140
padding-right: 4px;
108141
}
109142
.doc h1 {
110-
border-bottom: 1px solid blue;
111-
margin-top: 1em;
112-
margin-left: -.5em;
143+
border-bottom: 2px solid #EEE;
144+
padding-left: 12px;
145+
}
146+
147+
.doc blockquote {
148+
-webkit-margin-before: 0.5em;
149+
-webkit-margin-after: 0.5em;
150+
-webkit-margin-start: 20px;
151+
-webkit-margin-end: 0px;
113152
}
114153

115154
.top .top_links {
@@ -119,10 +158,31 @@ h1 {
119158
.top a.top_link {
120159
float: right;
121160
margin: 2px;
161+
border: 1px solid #999;
162+
padding: 5px 10px 5px 10px;
163+
margin-top: 8px;
164+
margin-right: 15px;
165+
background-color: #555;
122166
}
123167

124168
img {
125-
border: 1px solid #aaa;
126169
margin: auto;
127170
display: block; /* otherwise centering doesn't happen */
128171
}
172+
173+
/* Clearfix for bottom of page */
174+
.bottom {
175+
clear: both;
176+
*zoom: 1;
177+
}
178+
179+
.bottom:before,
180+
.bottom:after {
181+
display: table;
182+
line-height: 0;
183+
}
184+
185+
.bottom:after {
186+
clear: both;
187+
}
188+

public/css/step.css

+29-20
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
@charset "UTF-8";
22

3-
.step h1 > span.prefix {
4-
color: blue;
3+
.step h1 {
4+
border: 0;
55
}
6-
.step blockquote {
7-
border-left: 1px dotted blue;
8-
padding-left: 1.5em;
9-
margin-left: .25em;
6+
7+
span.prefix {
8+
font-size: 0.7em;
9+
padding-left: 8px;
10+
}
11+
12+
.step h1 {
13+
font-size: 1em;
14+
padding: 10px 0 0 10px;
15+
}
16+
17+
.step h1 span.prefix {
18+
font-size: 0.9em;
19+
padding-left: 0;
20+
padding-right: 8px;
1021
}
1122

1223
img.noborder {
@@ -38,11 +49,13 @@ img.noborder {
3849

3950
.important {
4051
border: 1px solid red;
52+
border: 5px solid maroon;
4153
}
4254

4355
.tip {
4456
border: 1px solid blue;
4557
padding: 1em;
58+
border: 10px solid #eee;
4659
}
4760

4861
.tip > span {
@@ -66,32 +79,28 @@ div.back:before {
6679
content: "← ";
6780
}
6881

69-
.doc > div > h1 {
70-
padding-left: .25em;
71-
}
72-
7382
.doc > div {
7483
padding-bottom: 1em;
7584
}
7685

7786
.goals > h1 {
78-
background-color: #FECACD;
87+
border-left: 20px solid #FECACD;
7988
}
8089

8190
.steps > h1 {
82-
background-color: #FBFFCA;
91+
border-left: 20px solid #FBFFCA;
8392
}
8493

8594
.explanation > h1 {
86-
background-color: #C8FFC9;
95+
border-left: 20px solid #C8FFC9;
8796
}
8897

8998
.deploying > h1 {
90-
background-color: #B0DEE7;
99+
border-left: 20px solid #B0DEE7;
91100
}
92101

93102
.further-reading > h1 {
94-
background-color: #87e5f2;
103+
border-left: 20px solid #87e5f2;
95104
}
96105

97106
table.bordered td,
@@ -104,19 +113,19 @@ table.bordered tr {
104113
}
105114

106115
.requirements > h1 {
107-
background-color: #93B5DA;
116+
border-left: 20px solid #93B5DA;
108117
}
109118

110119
.discussion > h1 {
111-
background-color: #92F59A;
120+
border-left: 20px solid #92F59A;
112121
}
113122

114123
.hints > h1 {
115-
background-color: #86DFD4;
124+
border-left: 20px solid #86DFD4;
116125
}
117126

118127
.tools_and_references > h1 {
119-
background-color: #C8A9E0;
128+
border-left: 20px solid #C8A9E0;
120129
}
121130

122131
.console > pre {
@@ -131,7 +140,7 @@ table.bordered tr {
131140
}
132141

133142
.fuzzy-result {
134-
margin-bottom: 20px;
143+
margin : 20px;
135144
}
136145
.fuzzy-result > pre {
137146
margin-bottom: 0px;

sites/frontend/frontend.step

+1-3
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ end</pre>
9494
</div>
9595
MARKDOWN
9696

97-
choice do
97+
9898
option "Are your tools installed?" do
9999
link "get_a_sticker"
100100
end
101101

102102
option "Do you need to set up your tools?" do
103103
link "tool_installation"
104104
end
105-
end
106-

0 commit comments

Comments
 (0)