This repository has been archived by the owner on Jun 25, 2019. It is now read-only.
/
_code.scss
204 lines (170 loc) · 3.47 KB
/
_code.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*--------------------- Layout and Typography ----------------------------*/
pre, tt, code {
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0;
}
pre em,
pre strong,
pre em strong,
pre strong em {
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
}
body code pre span[class] {
color: #000000;
} /* Set all span elements to black in code elements.*/
/* The code goes in here. */
.code-block code {
clear: left;
display: block;
position: relative;
}
/* Stretch class for comments that point to multiple lines of code */
.stretch {
background-color: #eee;
padding: 4px;
}
.stretch .code-comment,
.stretch .one-line:first-child,
.stretch span.one-line {
background: transparent;
padding-top: 0;
padding-bottom: 0;
margin-bottom: 0;
}
.stretch span.one-line {
padding-right: 4px;
padding-left: 0;
}
.stretch .code-comment {
padding-left: 1.0em;
}
div.example code pre span[class],
div.example .code-comment,
div.example .toggle {
color: #ffffff;
}
div.example .source-code {
background: transparent;
}
div.example .one-line:first-child,
div.example .code-comment,
div.example .stretch {
background-color: rgb(136,138,138);
}
div.example .no-comment .one-line:first-child {
background: transparent;
}
/* Div wrapper for code blocks */
.code-block {
font-size: 80%;
line-height: 1.4em;
margin: 1.4em 1em 0.8em;
}
.code-comment-pair code pre {
width: 100%;
}
/* Matches padding for code commented lines */
.one-line {
padding-left: 4px;
}
.one-line:first-child,
.code-comment {
display: inline-block;
background-color: #eee;
padding: 4px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.one-line:first-child {
margin-bottom: 3px;
width: 60%;
}
.no-comment .one-line:first-child {
background-color: transparent;
padding-top: 0;
padding-bottom: 0;
padding: 0;
width: auto;
margin-bottom: 0;
padding-left: 4px;
}
.code-comment {
margin-bottom: 2px;
position: relative;
}
.offset-up span.one-line,
.offset-down span.one-line {
width: 100%;
}
.offset-up .code-comment {
margin-bottom: 0;
position: absolute;
right: 0;
margin-top: 0.2em;
}
.offset-down .one-line:first-child {
width: 100%;
}
.offset-down code {
position: relative;
}
.offset-down .code-comment {
float: right;
position: absolute;
margin-top: 2.1em;
right: 0;
top: 0;
}
/* Wrapper for every pairing of code and comment.
Used to catch the .code-comment-line inside of
a relatively positioned parent. */
.code-comment-pair {
display: block;
position: relative;
clear: both;
margin: 0 0 2px 0;
padding: 0px;
overflow-y: auto;
overflow-x: hidden;
}
/* Div wrapper for code comments */
.code-comment {
clear: right;
color: #000;/*#444;*/
display: block;
float: right;
font-family: sans-serif;
font-style: bold;
margin-top: 0.0em;
position: relative;
width: 40%;
padding-left: 1.0em;
/* hack to remove 1px white space in Safari on Lion */
/*left: -1px;*/
}
.source-code {
overflow-y: auto;
clear: both;
position: relative;
}
.stretch {
background-color: #eee;
padding: 4px;
}
/* == CODE IN EXERCISES */
div.example code pre span[class] {
color: #ffffff;
}
div.example .one-line:first-child,
div.example .code-comment,
div.example .stretch {
background-color: rgb(136,138,138);
}
div.example .no-comment .one-line:first-child {
background: transparent;
}
.offset-up {
overflow-y: visible;
overflow-x: visible;
}