-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
executable file
·832 lines (784 loc) · 30.9 KB
/
index.html
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kick Ass with Sass</title>
<meta name="description" content="Although it’s powerful, Sass can be intimidating for beginners. In this session, we'll go over what you need to know to get started kicking boring, bloated CSS's ass with Sass.">
<meta name="author" content="Lauren Byrwa">
<meta name="author" content="Heather Rodriguez">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/night.css" id="theme">
<link rel="stylesheet" href="css/styles.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Presenetation -->
<div class="slides">
<!-- Introduction -->
<section>
<section data-background="images/title-screen-1024x768.jpg" alt="Kick Ass with Sass">
<!-- <img src="images/title-screen.png" alt="Kick Ass with Sass" />
--> <h1 class="offscreen">Kick Ass with Sass</h1>
<aside class="notes">
DON'T INTRODUCE US YET, JUST THE TALK
This talk is aimed at those developers and/or designers who are comfortable with CSS already and are curious to hear more about Sass and how it can kick boring, bloated CSS ass.
We’re going to be focusing our talk today on:
What is Sass
Why you should use it
Some of the features and terminology of Sass
and challenges to incorporating Sass into your workflow
</aside>
</section>
<section>
<h2>Who Are We</h2>
<p>Lauren Byrwa<br />
<small><a href="http://twitter.com/labyrwa">@labyrwa</a></small><br />
<small>Front End Developer at <a href="http://palantir.net/">Palantir.net</a></small></p>
<p>Heather Rodriguez<br />
<small><a href="http://twitter.com/hrodrig">@hrodrig</a></small><br />
<small>Web Developer at <a href="http://rockcreeksm.com/">Rock Creek Strategic Marketing</a></small></p>
<aside class="notes">NOW INTRODUCE US. Basically we rock!</aside>
</section>
<section>
<h2>Slides</h2>
<p><large>Available Online</large></p>
<a href="http://labyrwa.github.io/kick-ass-sass/#/">http://labyrwa.github.io/kick-ass-sass/</a>
</section>
</section>
<!-- What is Sass? -->
<section>
<section data-background="images/KickAss3-lg.jpg">
<h2>What is Sass?</h2>
</section>
<section>
<img src="images/i-dunno-lol_1_.jpg" alt="doggy who doesn't know">
<aside class="notes">
You may be asking yourself, What is Sass? Is it an entirely new language? Do I really need to use the command line? It’s so scary!
</aside>
</section>
<section>
<h2>Sass is CSS Extended</h2>
<p class="fragment" >Sass is a lean, clean CSS extension language:<br />You write Sass; your browser sees CSS. </p>
<img src="images/scss-to-sass.png" alt="Illustration of how Sass converts .scss files into .css files">
<aside class="notes">
Sass is a scripting language that gets interpreted into CSS stylesheets. You write your Sass in files with the extension .scss, and then it gets translated into CSS that your browser can read (browsers don’t understand straight Sass). Sass is based on CSS, so you’re not learning an entirely different new language. It’s like CSS but leaner, and cleaner.
CSS is valid Sass.
walk through this really slowly to set the stage for how this works (go into some detail)
Compiling is where the magic happens!
</aside>
</section>
<section>
<h3>What you write</h3>
<pre><code>$bold: 700;
$link-color: #33CCFF;
$sans-serif: 'Arial, Helvetica, sans-serif';
body {
font-family: $sans-serif;
a {
font-weight: $bold;
color: $link-color;
}
ul {
list-style-type: none;
}
}
</code></pre>
<h3>What the browser sees</h3>
<pre><code>body {
font-family: "Arial, Helvetica, sans-serif";
}
body a {
font-weight: 700;
color: #33ccff;
}
body ul {
list-style-type: none;
}
</code></pre>
<aside class="notes">
Sass is what you’re writing; after Sass does the compiling, the browser will see the CSS.
</aside>
</section>
<section>
<h2>Sass Facts</h2>
<ul>
<li class="fragment">Sass is implemented through a Ruby gem </li>
<li class="fragment">Stands for "Syntactically Awesome Stylesheets"</li>
<li class="fragment">Designed by Hampton Catlin and developed by Natalie Weizenbaum in 2007</li>
<li class="fragment">The most widely used CSS preprocessor within our community</li>
</ul>
</section>
</section>
<!-- Problems with CSS -->
<section>
<section data-background="http://static.comicvine.com/uploads/original/11112/111120335/3260125-kick-ass+2.jpg">
<h2>Why Sass?</h2>
</section>
<section>
<h2>The problem with CSS</h2>
<img class="right half fragment" src="images/110112-walter-reeves_3.jpg" alt="plants growing all over and entirely covering a house">
<ul class="half left">
<li class="fragment">Repetitive and messy</li>
<li class="fragment">Bad coupling (especially in Drupal)</li>
<li class="fragment">Bloated code</li>
<li class="fragment">Difficult to maintain</li>
<li class="fragment">Bad for performance</li>
</ul>
<aside class="notes">
as projects get larger, CSS doesn’t scale in a maintainable and organized fashion.
</aside>
</section>
<section data-background="images/messy-code.png">
<img src="images/The_face_palm_of_agrivation.png" alt="Stick figure at a computer holding his face in his hands">
<aside class="notes">
One of the fundamental principles of good performance and good code is the concept of Don’t Repeat Yourself. Whatever CSS organizational methodology you adopt, whether it’s BEM, OOCSS, or SMACSS, all best practices agree that more code is worse code.
Harder to maintain, worse for performance, more difficult for those team members working on your project or coming after you to clean up your mess.
</aside>
</section>
<section data-background="images/chloe-moretz-kick-ass.jpg">
<h2>Fight back with Sass!</h2>
</section>
</section>
<!-- Benefits of Sass -->
<section>
<section>
<h2>Benefits of using Sass</h2>
<ul>
<li class="fragment">Write fewer lines of code with less repetition (stay DRY!)</li>
<li class="fragment">Change values in one place; watch them update everywhere!</li>
<li class="fragment">Spend less time in development</li>
<li class="fragment">Improve site performance</li>
<li class="fragment">Organize files for better maintainability</li>
<li class="fragment">Use cool features such as functions and mixins absent from CSS</li>
</ul>
<aside class="notes">
Define components once and reuse them throughout your project, rather than repeating the same CSS over and over (change your font-size or font-family in one line and it will update everywhere!)
Nest your CSS for more logical, maintainable stylesheets (use wisely!)
Perform advanced processing before your CSS is compiled, such as calculating color functions or creating image sprites
</aside>
</section>
<section>
<h2>#winning</h2>
<img src="images/jamaicas-usain-bolt-strikes-his-famous-pose-with-his-gold-medal-at-the-mens-200m-victory-ceremony-during-the-london-2012-olympic-games-at-the-olympic-stadium-august-9-2012.jpg" alt="Jamacias Usain Bolt strikes his famous pose with his gold medal at the mens 200m victory ceremony during the london 2012 olympic games"/>
</section>
</section>
<!-- Features of Sass -->
<section>
<section data-background="http://i1.wp.com/comics-x-aminer.com/wp-content/uploads/2013/07/h32.jpg">
<h2>Features</h2>
<aside class="notes">
Now we're going to go through some of the tools in your Sass-y utility belt
</aside>
</section>
<section>
<h3>Variables</h3>
<p class="fragment">Variables store small pieces of information for reuse throughout your stylesheets.</p>
<ul>
<li class="fragment">Colors</li>
<li class="fragment">Font stacks</li>
<li class="fragment">Breakpoints</li>
<li class="fragment">Common font sizes</li>
</ul>
</section>
<section>
<p>$variable-name: code;</p>
<pre class="fragment"><code>// Fonts
$nimbus-sans: "nimbus-sans", Times, serif;
$bold: 500;
$normal: 400;
$light: 300;
</pre></code>
<pre class="fragment"><code>// Colors
$highlight-color: #ffca0a;
$link-color: #ff0000;
$black: #000000;
$white: #ffffff;
$charcoal: darken($white, 70);
</code></pre>
</section>
<section>
<h3>SCSS</h3>
<pre class="fragment"><code>// Fonts
$nimbus-sans: "nimbus-sans", Times, serif;
$highlight-color: #ffca0a;
$bold: 500;
blockquote{
font-family: $nimbus-sans;
color: $highlight-color;
font-weight: $bold;
}
</pre></code>
<h3>CSS</h3>
<pre class="fragment"><code>// Colors
blockquote{
font-family: "nimbus-sans", Times, serif;
color: #ffca0a;
font-weight: 500;
}
</code></pre>
</section>
<section>
<h3>Operators</h3>
<p class="fragment">Math is hard. Let Sass take care of the work.</p>
<aside class="notes">Operators allow you to let Sass do the Math for you. And are especially great for creating custom grids and layouts.</aside>
</section>
<section>
<h4>SCSS</h4>
<pre class="fragment"><code>.container{
width: 100%;
}
article[role=”main”]{
float: left;
width: 600px / 960px * 100%;
}
aside[role=”complimentary”]{
float: right;
width: 300px / 960px * 100%;
}
</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.container{
width: 100%;
}
article[role=”main”]{
float: left;
width: 62.5%;
}
aside[role=”complimentary”]{
float: left;
width: 31.25%;
}
</code></pre>
</section>
<section>
<h3>Nesting</h3>
<p class="fragment">Visual hierarchy makes it easy to understand and organize selector relationships.</p>
</section>
<section>
<h4>SCSS</h4>
<pre class="fragment"><code>.breadcrumb {
font-size: .8em;
margin-bottom: 2rem;
li {
display: inline;
list-style-type: none;
margin: 0;
padding: 0;
}
a{
color: $mirage;
}
}
</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.breadcrumb {
font-size: .8em;
margin-bottom: 2rem;
}
.breadcrumb li {
display: inline;
list-style-type: none;
margin: 0;
padding: 0;
}
.breadcrumb a{
color: $mirage;
}
</code></pre>
</section>
<section>
<img src="images/sass-tips-nest.jpg" alt="Spiderman meme that says, 'With great nesting power comes great responsibility'" />
<p>Nest Sparingly and avoid overly specific code</p>
</section>
<section>
<h3>Ampersand (&)</h3>
<p class="fragment">Use to merge two selectors, either preceding or following an element.</p>
<p class="fragment">Use Cases:</p>
<ul>
<li class="fragment">Pseudo elements</li>
<li class="fragment">Hover and focus states</li>
<li class="fragment">Modernizr, HTML5 Boilerplate, Google Webfont loader classes</li>
</ul>
</section>
<section>
<h4>Preceeding Ampersand (&)</h4>
<h5>SCSS</h5>
<pre class="fragment"><code>.menu a{
color: $crimson;
&:hover{
color: $white;
}
}
</code></pre>
<h5 class="fragment">CSS</h5>
<pre class="fragment"><code>.menu a{
color: #ed1c24;
}
.menu a:hover{
color: #ffffff;
}
</code></pre>
</section>
<section>
<h4>Trailing Ampersand (&)</h4>
<h5>SCSS</h5>
<pre class="fragment"><code>.accordion__header{
margin: 0;
background: url(../images/retina/accordion-down.png) no-repeat;
background-size: 13px;
.lt-ie9 &{
background: url(../images/ie/accordion-down.png) no-repeat;
}
}
</code></pre>
<h5 class="fragment">CSS</h5>
<pre class="fragment"><code>.accordion__header {
margin: 0;
background: url(../images/retina/accordion-down.png) no-repeat;
background-size: 13px;
}
.lt-ie9 .accordion__header {
background: url(../images/ie/accordion-down.png) no-repeat;
}
</code></pre>
</section>
<section>
<a href="http://www.sitepoint.com/architecture-sass-project/">
<img src="images/1393307247whatif-meme-folder.jpg" alt="Morpheus meme that says 'What if I told you you don't have to put all your sass files in one folder'"/>
</a>
</section>
<section>
<h3>Partials</h3>
<p class="fragment"> Split your CSS into smaller, more maintainable snippets</p>
<p class="fragment">Partials are NOT standalone CSS files</p>
<aside class="notes">
COMPARTMENTALIZE
User doesn’t see the partials as separate CSS files; partials are important to make code more findable and organized for your benefit.
Partials are meant to be IMPORTED
</aside>
</section>
<section>
<p>_filename.scss</p>
<pre class="fragment"><code>_alerts.scss
_buttons.scss
_checkboxes.scss
_footer.scss
_forms.scss
_icons.scss
_menus.scss
_messages.scss
_throbbers.scss
_typography.scss
</code></pre>
</section>
<section>
<h3>Import</h3>
<img class="half right" src="images/importing-diagram1.png" alt="diagram showing three different files being combined into one file"/>
<ul class="half left">
<li class="fragment">Use @import to combine partials into one file</li>
<li class="fragment">One HTTP request per non-partial file</li>
<li class="fragment">CSS uses @import but creates many HTTP requests</li>
</ul>
</section>
<section>
<pre class="fragment"><code>@import "base";
@import "reset";
@import "layouts/responsive";
@import "components/header";
@import "components/navigation";
@import "components/messages";
@import "components/tabs";
@import "components/morelinks";
@import "components/blocks";
@import "components/unpublished";
@import "print";
</code></pre>
<aside class="notes">
all of the partials listed here would be combined into a single styles.scss
that file would then be compiled into one stylesheet, styles.css, that the browser could read
</aside>
</section>
<section>
<h3>Mixins</h3>
<img class="half right" src="http://www.ameliapowerdesign.com/blog/wp-content/uploads/2012/09/sassy-mixins1.jpg" alt="ecard of a guy mixing drinks that says, 'our mixins will get you just as sassy with none of the regret the next morning'" />
<ul class="left half">
<li class="fragment">Groupings of CSS declarations you define once and reuse throughout website</li>
<li class="fragment">Can include variables</li>
<li class="fragment">Use cases:
<ul>
<li class="fragment">retina sprites</li>
<li class="fragment">clearfix</li>
<li class="fragment">breakpoints</li>
<li class="fragment">CSS3/Vendor prefixes</li>
</ul>
</li>
</ul>
</section>
<section>
<h4>Mixin</h4>
<pre><code class="fragment">@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
</code></pre>
<h4 class="fragment">SCSS</h4>
<pre class="fragment"><code>.hover-content--featured{
@include border-radius(10px);
background: $viking;
font-size: 1.333333333rem;
font-weight: $semibold;
height: 100%;
}
</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.hover-content--featured{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
border-radius: 10px;
background: $viking;
font-size: 1.333333333rem;
font-weight: $semibold;
height: 100%;
}
</code></pre>
</section>
<section>
<h3>Extend/Inheritance</h3>
<p class="fragment">Using @extend lets you share CSS properties from one selector to another. </p>
<p class="fragment">It really helps keep your CSS DRY.</p>
</section>
<section>
<h4>SCSS</h4>
<pre class="fragment"><code>.btn{
background: $whitesmoke;
color: $mirage;
padding: .6rem .8rem;
padding-right: 2.666666667rem;
}
.btn--expand{
@extend .btn;
background: $crimson;
padding-right: 2.133333333rem;
}
</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.btn,
.btn--expand{
background: $whitesmoke;
color: $mirage;
padding: .6rem .8rem;
padding-right: 2.666666667rem;
}
.btn--expand{
background: $crimson;
padding-right: 2.133333333rem;
}
</code></pre>
</section>
<section>
<h3>When do you use a @mixin vs @extend?</h3>
<p class="fragment">@mixin repeats the code every time and the CSS gets bloated</p>
<p class="fragment">@extend will add the selectors together and then output the code just once</p>
<aside class="notes">
MIXIN - So much for not repeating ourselves
EXTEND - This is DRYer, however it can still get kind of bloated and messy especially if you never use just “.box” in the website
</aside>
</section>
<section>
<h4>Mixin - SCSS</h4>
<pre class="fragment"><code>@mixin element-invisible{
position: absolute;
height: 1px;
width: 1px;
overflow: hidden;
}
.foo{
@include element-invisible;
}
.bar{
@include element-invisible;
}
</pre></code>
<h4 class="fragment">Mixin - CSS</h4>
<pre class="fragment"><code>.foo{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
.bar{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
</pre></code>
</section>
<section>
<h4>Extend - SCSS</h4>
<pre class="fragment"><code>.element-invisible{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
.foo{
@extend element-invisible;
}
.bar{
@extend element-invisible;
}
</pre></code>
<h4 class="fragment">Extend - CSS</h4>
<pre class="fragment"><code>.element-invisible,
.foo,
.bar{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
</pre></code>
</section>
<section>
<h3>So really, when do you use @mixin vs @extend?</h3>
<p class="fragment">ANSWER:</p>
<p class="fragment">%placeholder with @extend</p>
</section>
<section>
<h3>Placeholder</h3>
<p class="fragment">Using placeholder (%) with @extend lets you combine the selectors</p>
<p class="fragment">No worries about unused selectors</p>
</section>
<section>
<h4>SCSS</h4>
<pre class="fragment"><code>%element-invisible{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
.foo{
@extend element-invisible;
}
.bar{
@extend element-invisible;
}
</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.foo,
.bar{
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
</code></pre>
</section>
<section>
<h3>So when do you use each?</h3>
<h4 class="fragment">Mixin:</h4>
<p class="fragment">When you use a variable or the output changes</p>
<h4 class="fragment">Extend:</h4>
<p class="fragment">when you’re using the original selector already</p>
<h4 class="fragment"> Placeholder:</h4>
<p class="fragment">when the code is always the same</p>
<p class="fragment">when you don’t need the original selector</p>
</section>
</section>
<!-- Sass with Drupal -->
<section>
<section data-background="http://eresus.co/sites/default/files/styles/690x340/public/blog-images/sass_drupal_0.jpg">
</section>
<section>
<h2>Drupal and Sass</h2>
<p class="fragment">Base themes that support Sass:</p>
<ul>
<li class="fragment">Zen 5</li>
<li class="fragment">Omega 4</li>
<li class="fragment">Aurora</li>
<li class="fragment">Adaptive Theme</li>
<li class="fragment">and others…</li>
</ul>
</section>
<section>
<h2>Getting Started</h2>
<h4 class="fragment">Install Ruby</h4>
<ul>
<li class="fragment">Macs already come with Ruby (win for us!)</li>
<li class="fragment"><a href="http://rubyinstaller.org/">Download Ruby for PC</a></li>
</ul>
<p class="fragment">Open Terminal and run a short command</p>
<pre class="fragment"><code>gem install sass</code></pre>
<p class="fragment"><strong>YAY! YOU’VE INSTALLED SASS</strong></p>
</section>
<section>
<h2>Compiling your Sass</h2>
<p class="fragment">Sass can compile itself</p>
<pre class="fragment"><code>sass --watch path/sass-directory</code></pre>
<p class="fragment">So can libraries such as Compass or Bourbon, which can also add much more functionality</p>
<pre class="fragment"><code>gem install compass
compass watch
compass compile
</code></pre>
<p class="fragment">If you're using a task runner like Gulp and Grunt, that will compile too.</p>
<p class="fragment">Not a Terminal fan? Try Scout or CodeKit</p>
</section>
</section>
<!-- Challenges with Sass -->
<section>
<section>
<h2>Sass Challenges</h2>
<p class="fragment">Nesting: can get crazy long and over specific</p>
<p class="fragment">Versioning: Bundler to keep team members on same gem</p>
<p class="fragment">Keep output in mind: Using @import to separate out files requires a logical structure</p>
<p class="fragment"><strong>If you write bad CSS, you will write bad Sass</strong></p>
</section>
</section>
<!-- More to Learn -->
<section>
<section>
<h2>More stuff to Sass out About</h2>
<div class="half left">
<p class="fragment"><strong>Data type:</strong> a way of classifying a piece of information. Common examples in programming are booleans, strings and integers</p>
<p class="fragment"><strong>Control structure:</strong> instruction to the computer on how to evaluate a piece of data.</p>
</div>
<img class="half right" src="images/the-sass-is-strong-in-this-one.png" alt="Darth Vader meme that says, 'The sass is strong with this one'" />
<aside class="notes">Once you get used to using Sass it becomes really powerful when you start talking about Data Types and Control Structures. While we could go do an entire session on these more advanced features we're just going to go over a couple of highlights.</aside>
</section>
<section>
<h3>Data Types & Control Structures</h3>
<div class="fragment half left">
<h4>Data Types</h4>
<ul>
<li>Numbers</li>
<li>Strings</li>
<li>Colors</li>
<li>Booleans</li>
<li>Null</li>
<li>Lists</li>
<li>Maps</li>
</ul>
</div>
<div class="fragment half right">
<h4>Control Structures</h4>
<ul>
<li>@while</li>
<li>@for</li>
<li>@if/@elseif/@else</li>
<li>@each</li>
</ul>
</div>
<aside class="notes">While all of these data types have a number of helpful functions that we can work with today we're going to focus on Maps and Lists</aside>
</section>
<section>
<h3>Lists and Maps</h3>
<p class="fragment">Lists = arrays<br />Maps = hashes</p>
<pre class="fragment"><code>$social: (
"facebook": '\f204',
"twitter": '\f202',
"linkedin": '\f207',
"pinterest": '\f209',
"github": '\f200',
"dribbble": '\f201',
"instagram": '\f215',
"email": '\f410'
);</code></pre>
<p class="fragment">And can also be multidimensional</p>
<pre class="fragment"><code>$mega-social: (
"facebook": ( content: "\f204", coords: 0 0 ),
"twitter": ( content: "\f202", coords: 0 -64px ),
"linkedin": ( content: "\f207", coords: 0 -128px )
);</code></pre>
</section>
<section>
<h3>@each</h3>
<h4 class="fragment">Mixin</h4>
<pre class="fragment"><code>@each $network, $content in $social {
.#{$network} a:before {
content: $content;
}
}</code></pre>
<h4 class="fragment">CSS</h4>
<pre class="fragment"><code>.facebook a:before {
content: '\f204';
}
.twitter a:before {
content: '\f202';
}
.linkedin a:before {
content: '\f207';
}
...</code></pre>
</section>
<section>
<h2>Resources to learn more</h2>
<ul>
<li><a href="http://sass-lang.com/documentation/file.SASS_REFERENCE.html#data_types">Sass Documentation (Data Types)</a></li>
<li><a href="http://viget.com/extend/sass-maps-are-awesome">Sass Maps Are Awesome!</a> - Viget</li>
<li><a href="http://thesassway.com/news/sass-3-3-released">Maptastic Maple</a> - The Sass Way</li>
<li><a href="http://sass-lang.com/documentation/file.SASS_REFERENCE.html#control_directives__expressions">Sass Documentation (Control Directives & Expressions)</a></li>
<li><a href="http://thesassway.com/intermediate/if-for-each-while">Sass control directives</a> - The Sass Way</li>
<li><a href="http://davidwalsh.name/future-sass">The Future of Sass</a> - David Walsh</li>
</ul>
</section>
<section data-background="http://4.bp.blogspot.com/-mS9-GrccevM/UlBKRAzBynI/AAAAAAAALGo/ozHiOIxp4m8/s00/Wallpapers_Kick_Ass_02.jpg">
<h2>Any Questions?</h2>
<p>
<small>Lauren Byrwa</a> / <a href="http://twitter.com/labyrwa">@labyrwa</a></small><br />
<small>Heather Rodriguez / <a href="http://twitter.com/hrodrig">@hrodrig</a></small>
</p>
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>