add warning hook + CSS class for Rmd-based lessons (#455)
[rnaseq-cwl-training.git] / assets / css / lesson.scss
1 ---
2 ---
3
4 //----------------------------------------
5 // Colors.
6 //----------------------------------------
7
8 // branding
9 $color-brand:       #2b3990 !default;
10
11 // code boxes
12 $color-error:       #bd2c00 !default;
13 $color-warning:     #cda01d !default;
14 $color-output:      #303030 !default;
15 $color-source:      #360084 !default;
16
17 // blockquotes
18 $color-callout:     #f4fd9c !default;
19 $color-challenge:   #eec275 !default;
20 $color-checklist:   #dfd2a0 !default;
21 $color-discussion:  #eec275 !default;
22 $color-keypoints:   #7ae78e !default;
23 $color-objectives:  #daee84 !default;
24 $color-prereq:      #9cd6dc !default;
25 $color-solution:    #ded4b9 !default;
26 $color-testimonial: #fc8dc1 !default;
27
28 //----------------------------------------
29 // Specialized code blocks.
30 //----------------------------------------
31
32 @mixin cdSetup($color) {
33     color: $color;
34     border: solid 1px $color;
35     border-left: solid 5px $color;
36     margin: 15px 5px 10px 0;
37     border-radius: 4px 0 0 4px;
38 }
39
40 .error   { @include cdSetup($color-error); }
41 .warning { @include cdSetup($color-warning); }
42 .output  { @include cdSetup($color-output); }
43 .source  { @include cdSetup($color-source); }
44
45 .bash, .language-bash     { @include cdSetup($color-source); }
46 .make, .language-make     { @include cdSetup($color-source); }
47 .matlab, .language-matlab { @include cdSetup($color-source); }
48 .python, .language-python { @include cdSetup($color-source); }
49 .r, .language-r           { @include cdSetup($color-source); }
50 .sql, .language-sql       { @include cdSetup($color-source); }
51
52 .error::before,
53 .warning:before,
54 .output::before,
55 .source::before,
56 .bash::before, .language-bash::before,
57 .make::before, .language-make::before,
58 .matlab::before, .language-matlab::before,
59 .python::before, .language-python::before,
60 .r::before, .language-r::before,
61 .sql::before, .language-sql::before {
62     background-color: #f2eff6;
63     display: block;
64     font-weight: bold;
65     padding: 5px 10px;
66 }
67
68 .error::before  { background-color: #ffebe6; content: "Error"; }
69 .warning:before { background-color: #f8f4e8; content:" Warning"; }
70 .output::before { background-color: #efefef; content: "Output"; }
71 .source::before { content: "Code"; }
72 .bash::before, .language-bash::before { content: "Bash"; }
73 .make::before, .language-make::before { content: "Make"; }
74 .matlab::before, .language-matlab::before { content: "Matlab"; }
75 .python::before, .language-python::before { content: "Python"; }
76 .r::before, .language-r::before { content: "R"; }
77 .sql::before, .language-sql::before { content: "SQL"; }
78
79
80 //----------------------------------------
81 // Specialized blockquote environments for learning objectives, callouts, etc.
82 //----------------------------------------
83
84 $codeblock-padding: 5px !default;
85
86 @mixin bkSetup($color, $glyph) {
87
88   $gradientcolor1: $color;
89   $gradientcolor2: scale-color($color, $lightness: 10%);
90
91   padding: 0 0 $codeblock-padding $codeblock-padding;
92   border: 1px solid;
93   border-color: $color;
94   border-radius: 4px;
95
96   margin: 15px 5px 10px 0;
97
98   h2 {
99     padding-top: $codeblock-padding;
100     padding-bottom: $codeblock-padding;
101     font-size: 20px;
102     background: linear-gradient(to bottom, $gradientcolor1, $gradientcolor2);
103     border-color: $color;
104     margin-top: 0px;
105     margin-left: -$codeblock-padding; // to move back to the left margin of the enclosing blockquote
106   }
107   h2:before {
108     font-family: 'Glyphicons Halflings';
109     content: $glyph;
110     float: left;
111     padding-left: $codeblock-padding;
112     padding-right: $codeblock-padding;
113     display: inline-block;
114     -webkit-font-smoothing: antialiased;
115   }
116
117 }
118
119 .callout{ @include bkSetup($color-callout, "\e146"); }
120 .challenge{ @include bkSetup($color-challenge, "\270f"); }
121 .checklist{ @include bkSetup($color-checklist, "\e067"); }
122 .discussion{ @include bkSetup($color-discussion, "\e123"); }
123 .keypoints{ @include bkSetup($color-keypoints, "\e101"); }
124 .objectives{ @include bkSetup($color-objectives, "\e085"); }
125 .prereq{ @include bkSetup($color-prereq, "\e124"); }
126 .solution{ @include bkSetup($color-solution, "\e105"); }
127 .testimonial{ @include bkSetup($color-testimonial, "\e143"); }
128
129 .callout h3,
130 .challenge h3,
131 .checklist h3,
132 .discussion h3,
133 .keypoints h3,
134 .objectives h3,
135 .prereq h3,
136 .solution h3,
137 .testimonial h3 {
138 font-size: 18px;
139 }
140
141 .challenge    { background-color: #eec27520; }
142 .callout      { background-color: #f4fd9c20; }
143 .challenge    { background-color: #eec27520; }
144 .checklist    { background-color: #dfd2a020; }
145 .discussion   { background-color: #eec27520; }
146 .keypoints    { background-color: #7ae78e20; }
147 .objectives   { background-color: #daee8420; }
148 .prereq       { background-color: #9cd6dc20; }
149 .solution     { background-color: #ded4b94d; }
150 .testimonial  { background-color: #fc8dc120; }
151
152 blockquote p {
153     margin: 5px;
154 }
155 blockquote :not(h2) + p {
156     padding-top: 1em;
157 }
158
159 //----------------------------------------
160 // Override Bootstrap settings.
161 //----------------------------------------
162
163 blockquote { font-size: inherit; }
164
165 code {
166   white-space: nowrap;
167   padding: 2px 5px;
168   color: #006cad;
169   background-color: #e7e7e7;
170 }
171
172 samp { hyphens: none; }
173
174 dt { margin-top: 20px; }
175 dd { margin-left: 2em; }
176
177 article img {
178     display: block;
179     margin: 20px auto;
180     max-width: 100%;
181 }
182
183 article h2 {
184   margin: 48px 0 16px;
185   border-bottom: solid 1px #eaecef;
186   padding-bottom: 0.3em;
187   line-height: 1.25;
188 }
189
190 article h3 { margin: 40px 0 16px; }
191
192 article pre {
193     margin: 0;
194     border: 0;
195 }
196
197 //----------------------------------------
198 // Miscellaneous.
199 //----------------------------------------
200
201 .figures h2 { margin-top: 100px; }
202
203 .maintitle {
204   text-align: center;
205 }
206
207 .footertext {
208   text-align: center;
209 }
210
211 footer .copyright,
212 footer .help-links
213 {
214     font-size: inherit;
215     margin-top: 10px;
216     margin-bottom: 10px;
217     font-weight: 500;
218     line-height: 1.1;
219 }
220
221 img.navbar-logo {
222   height: 40px; // synchronize with height of navbar
223   padding-top: 5px;
224   padding-right: 10px;
225 }
226
227 div.branding {
228   color: $color-brand;
229 }
230
231 ul,
232 ol {
233   padding-left: 2em;
234 }
235
236 span.fold-unfold {
237   margin-left: 1em;
238   opacity: 0.5;
239 }
240
241
242 //----------------------------------------
243 // Life cycle box
244 //----------------------------------------
245
246 div.life-cycle {
247     position: -webkit-sticky; /* Safari */
248     position: sticky;
249     top: 0;
250     z-index: 100;
251     font-size: 1.2em;
252     text-align: center;
253     margin-bottom: -1px;
254     border-radius: 0;
255 }
256
257 .pre-alpha {
258     color: #a94442;
259     background: #f2dede;
260 }
261
262 .alpha {
263     color: #8a6d3b;
264     background: #fcf8e3;
265 }
266
267 .beta {
268     color: #31708f;
269     background: #d9edf7;
270 }
271
272
273 //----------------------------------------
274 // keyboard key style, from StackExchange.
275 //----------------------------------------
276
277 kbd {
278     display: inline-block;
279     margin: 0 .1em;
280     padding: .1em .6em;
281     font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
282     font-size: 11px;
283     line-height: 1.4;
284     color: #242729;
285     text-shadow: 0 1px 0 #FFF;
286     background-color: #e1e3e5;
287     border: 1px solid #adb3b9;
288     border-radius: 3px;
289     box-shadow: 0 1px 0 rgba(12,13,14,0.2), 0 0 0 2px #FFF inset;
290     white-space: nowrap;
291     font-style: normal;
292 }