|
4 | 4 | <title>Title</title> |
5 | 5 | <meta charset="utf-8"> |
6 | 6 | <style> |
7 | | - @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
| 7 | + @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:200italic,400,700,400italic); |
8 | 8 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600italic,600); |
9 | 9 |
|
10 | | - body { font-family: 'Open Sans', sans-serif; } |
11 | | - h1, h2, h3 { |
12 | | - /*font-family: 'Yanone Kaffeesatz';*/ |
13 | | - font-family: 'Open Sans', sans-serif; |
14 | | - font-weight: normal; |
| 10 | + html { |
| 11 | + -webkit-font-smoothing: antialiased; |
| 12 | + } |
| 13 | + body, h1, h2, h3 { |
| 14 | + font-family: 'Open Sans', sans-serif; |
| 15 | + font-weight: 300; |
| 16 | + } |
| 17 | + .remark-container { |
| 18 | + background: #263238; |
| 19 | + } |
| 20 | + h1 { |
| 21 | + color: #ECEFF1; |
| 22 | + } |
| 23 | + h2 { |
| 24 | + color: #B0BEC5; |
| 25 | + font-weight: 400; |
| 26 | + } |
| 27 | + h3 { |
| 28 | + color: #9E9E9E; |
| 29 | + } |
| 30 | + a { |
| 31 | + color: #2196F3; |
| 32 | + text-decoration: none; |
| 33 | + } |
| 34 | + .colored { |
| 35 | + background: #607D8B; |
| 36 | + } |
| 37 | + .colored h2 { |
| 38 | + font-weight: 300; |
| 39 | + } |
| 40 | + strong { |
| 41 | + color: #607D8B; |
15 | 42 | } |
16 | 43 | .remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; } |
| 44 | + |
| 45 | + .remark-inline-code { |
| 46 | + background: #ECEFF1; |
| 47 | + color: #37474F; |
| 48 | + font-style: italic; |
| 49 | + padding: 0 5px; |
| 50 | + } |
17 | 51 | </style> |
18 | 52 | </head> |
19 | 53 | <body> |
20 | 54 | <textarea id="source"> |
21 | 55 |
|
22 | | -class: center, middle |
| 56 | +class: center, middle, colored |
23 | 57 |
|
24 | | -## Scytale |
| 58 | +## Scytale's |
25 | 59 | # CSS/SCSS Guidelines |
26 | 60 |
|
27 | 61 | --- |
|
36 | 70 |
|
37 | 71 | - [2.1.1](#2.1.1) <a name='2.1.1'></a> Use soft tabs (4 spaces) for indentation. This improves readability and keeps the space uniform |
38 | 72 |
|
39 | | -```sass |
| 73 | +```css |
40 | 74 | // bad |
41 | 75 | .avatar{ |
42 | 76 | border-radius: 50%; |
|
50 | 84 |
|
51 | 85 | --- |
52 | 86 |
|
| 87 | +### Formatting |
| 88 | + |
53 | 89 | - [2.1.2](#2.1.2) <a name='2.1.2'></a> Use classes for all selectors. Ids are reserved for E2E testing and data arguments are for JS libraries |
54 | 90 |
|
55 | | -```sass |
| 91 | +```css |
56 | 92 | // bad |
57 | 93 | #panel { |
58 | 94 | /* ... */ |
|
70 | 106 |
|
71 | 107 | --- |
72 | 108 |
|
| 109 | +### Formatting |
| 110 | + |
73 | 111 | - [2.1.3](#2.1.3) <a name='2.1.3'></a> Avoid using tag selectors. Tag selectors come at a small performance penalty |
74 | 112 |
|
75 | | -```sass |
| 113 | +```css |
76 | 114 | // bad |
77 | 115 | h3 { |
78 | 116 | /* ... */ |
|
86 | 124 |
|
87 | 125 | --- |
88 | 126 |
|
| 127 | +### Formatting |
| 128 | + |
89 | 129 | - [2.1.4](#2.1.4) <a name='2.1.4'></a> When using multiple selectors in a rule declaration, give each selector its own line. This way its much easier to find selectors when scanning the document |
90 | 130 |
|
91 | | -```sass |
| 131 | +```css |
92 | 132 | // bad |
93 | 133 | .panel, .box { |
94 | 134 | /* ... */ |
|
103 | 143 |
|
104 | 144 | --- |
105 | 145 |
|
| 146 | +### Formatting |
| 147 | + |
106 | 148 | - [2.1.5](#2.1.5) <a name='2.1.5'></a> Put a space before the opening brace `{` in rule declarations. In properties, put a space after, but not before, the `:` character. Put closing braces `}` of rule declarations on a new line. Put blank lines between rule declarations |
107 | 149 |
|
108 | | -```sass |
| 150 | +```css |
109 | 151 | // bad |
110 | 152 | .panel{ |
111 | 153 | font-size:2px;color:white} |
|
120 | 162 | --- |
121 | 163 |
|
122 | 164 | class: center, middle |
123 | | -## Sass |
| 165 | +## SCSS |
124 | 166 |
|
125 | 167 | --- |
126 | 168 |
|
|
130 | 172 |
|
131 | 173 | - [3.1.2](#3.1.2) <a name='3.1.2'></a> Order your `@extend`, `@include` declarations and regular CSS lastly with a newline between the last two. |
132 | 174 |
|
133 | | -```scss |
| 175 | +```css |
134 | 176 | .btn-green { |
135 | 177 | @extend %btn; |
136 | 178 | @include transition(background 0.5s ease); |
|
142 | 184 |
|
143 | 185 | --- |
144 | 186 |
|
| 187 | +### Syntax |
145 | 188 |
|
146 | 189 | - [3.1.3](#3.1.3) <a name='3.1.3'></a> Nested selectors, _if necessary_, go last, and nothing goes after them. Add whitespace between your rule declarations and nested selectors, as well as between adjacent nested selectors. Apply [3.1.2](#3.1.2) as above to your nested selectors. |
147 | 190 |
|
148 | | -```scss |
| 191 | +```css |
149 | 192 | .btn { |
150 | 193 | @extend %btn; |
151 | 194 |
|
|
176 | 219 |
|
177 | 220 | **Sass** |
178 | 221 |
|
179 | | -```sass |
| 222 | +```css |
180 | 223 | // Unless we call `@extend %icon` these properties won't be compiled! |
181 | 224 | %icon { |
182 | 225 | font-family: "Airglyphs"; |
|
195 | 238 |
|
196 | 239 | **Compiled CSS** |
197 | 240 |
|
198 | | -```sass |
| 241 | +```css |
199 | 242 | .icon-error, |
200 | 243 | .icon-success { |
201 | 244 | font-family: "Airglyphs"; |
|
216 | 259 |
|
217 | 260 | **Do not nest selectors more than three levels deep!** |
218 | 261 |
|
219 | | -```scss |
| 262 | +```css |
220 | 263 | .page-container { |
221 | 264 | .content { |
222 | 265 | .profile { |
|
241 | 284 |
|
242 | 285 | ### Components |
243 | 286 |
|
244 | | - |
| 287 | + |
245 | 288 |
|
246 | 289 | - [4.1.1](#4.1.1) <a name='4.1.1'></a> Name components will be named with at least two workds, seperated by a dash. |
247 | 290 |
|
248 | | -```sass |
| 291 | +```css |
249 | 292 | .like-button { |
250 | 293 | /* ... */ |
251 | 294 | } |
|
259 | 302 |
|
260 | 303 | ### Elements |
261 | 304 |
|
262 | | - |
| 305 | + |
263 | 306 |
|
264 | 307 | - [4.2.1](#4.2.1) <a name='4.2.1'></a> Each component may have elements. They should have classes that are only one word. |
265 | 308 |
|
266 | | -```sass |
| 309 | +```css |
267 | 310 | .search-form { |
268 | 311 | > .field { |
269 | 312 | /* ... */ |
|
278 | 321 | --- |
279 | 322 | ### Elements |
280 | 323 |
|
281 | | - |
| 324 | + |
282 | 325 |
|
283 | 326 |
|
284 | 327 | - [4.2.2](#4.2.2) <a name='4.2.2'></a> Always prefer to use the `>` child selector whenever possible. |
285 | 328 |
|
286 | | -```sass |
| 329 | +```css |
287 | 330 | .article-card { |
288 | 331 | .title { |
289 | 332 | /* okay */ |
|
298 | 341 | --- |
299 | 342 | ### Elements |
300 | 343 |
|
301 | | - |
| 344 | + |
302 | 345 |
|
303 | 346 |
|
304 | 347 | - [4.2.3](#4.2.3) <a name='4.2.3'></a> For elements that need two or more words, concatenate them without dashes or underscores. |
305 | 348 |
|
306 | | -```sass |
| 349 | +```css |
307 | 350 | .profile-box { |
308 | 351 | > .firstname { |
309 | 352 | /* ... */ |
|
319 | 362 |
|
320 | 363 | ### Variants |
321 | 364 |
|
322 | | - |
| 365 | + |
323 | 366 |
|
324 | 367 | - [4.3.1](#4.3.1) <a name='4.3.1'></a> Variants customize a component or an element. Variants are prefixed by a dash `-`. |
325 | 368 |
|
326 | 369 | --- |
327 | 370 |
|
328 | | -```sass |
| 371 | +### Variants |
| 372 | + |
| 373 | + |
| 374 | + |
| 375 | +```css |
329 | 376 | .search-form { |
330 | 377 | &.-prefixed { |
331 | 378 | /* ... */ |
|
341 | 388 |
|
342 | 389 | ### Nested components |
343 | 390 |
|
344 | | - |
| 391 | + |
345 | 392 |
|
346 | 393 | - [4.4.1](#4.4.1) <a name='4.4.1'></a> When a component may need to appear a certain way when nested in another component. Avoid modifying the nested component by reaching into it from the containing component. Instead, prefer to add a variant to the nested component and apply it from the containing component. |
347 | 394 |
|
348 | 395 | --- |
349 | 396 |
|
350 | | -```sass |
| 397 | +### Nested components |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | +```css |
351 | 402 |
|
352 | 403 | // bad |
353 | 404 | .article-header { |
|
381 | 432 |
|
382 | 433 | If you need to define these, try to define them in whatever context they will be in. |
383 | 434 |
|
384 | | -```sass |
| 435 | +```css |
385 | 436 | .article-list { |
386 | 437 | & { |
387 | 438 | @include clearfix; |
|
394 | 445 | } |
395 | 446 |
|
396 | 447 | .article-card { |
397 | | - & { |
398 | | - /* ... */ |
399 | | - } |
400 | | - > .image { |
401 | | - /* ... */ |
402 | | - } |
403 | | - > .title { |
404 | | - /* ... */ |
405 | | - } |
406 | | - > .category { |
407 | | - /* ... */ |
408 | | - } |
| 448 | + /* ... */ |
409 | 449 | } |
410 | 450 | ``` |
411 | 451 | </textarea> |
412 | 452 | <script src="https://gnab.github.io/remark/downloads/remark-latest.min.js"> |
413 | 453 | </script> |
414 | 454 | <script> |
415 | | - var slideshow = remark.create(); |
| 455 | + var slideshow = remark.create({ |
| 456 | + highlightStyle: 'zenburn' |
| 457 | + }); |
416 | 458 | </script> |
417 | 459 | </body> |
418 | 460 | </html> |
0 commit comments