-
Notifications
You must be signed in to change notification settings - Fork 7
/
index-gdi.html
4286 lines (3789 loc) · 167 KB
/
index-gdi.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
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Getting Sassy with CSS ~ Girl Develop It</title>
<meta name="description" content="This is a Girl Develop It Sass Shop curriculum. Designed originally by Julie Cameron for GDI Detroit. The course is intended to be one overview session lasting 6 hours, or two 3-hour sessions. I hope that you will build on this curriculum and turn it into an even more awesome class. Oh, and Sass is awesome! Go Girl Developers!">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/sassshop.css" id="theme">
<link rel="stylesheet" href="lib/css/rainbow.css">
<link rel="stylesheet" href="css/print/pdf.css" media="print">
<script src="lib/js/head.min.js"></script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- TODO : submodule examples/lists and push gh-pages -->
<div class="slides">
<!-- INTRO -->
<section>
<!-- Intro : Setup -->
<section>
<h3>Get Setup!</h3>
<div class="box">
<p class="hide"><strong>Wifi Network:</strong> <span class="js-wifi-name"></span></p>
<p class="hide"><strong>Password:</strong> <span class="js-wifi-pass"></span></p>
</div>
<div class="box"><strong>Slides</strong>: <a target="_blank" href="http://sassshop.com">SassShop.com</a></div>
<div class="left copy--xsmall" style="width: 48%;">
<div class="box--small"><strong>Recommended Tools:</strong></div>
<p><a target="_blank" href="http://www.sublimetext.com">Sublime Text</a></p>
<p><span class="blue">Terminal or Command Prompt / Git Bash</span></p>
<p><a target="_blank" href="http://google.com/chrome">Google Chrome</a></p>
<p><a target="_blank" href="https://chrome.google.com/webstore/detail/livepage/pilnojpmdoofaelbinaeodfpjheijkbh?hl=en">LivePage</a><br />
</p>
</div>
<div class="right copy--xsmall" style="width: 48%;">
<div class="box--small"><strong>Get Ready!</strong></div>
<p class="box--small"><a href="http://sass-lang.com/install" target="_blank">Install Sass</a> <span class="copy--small">(via Command Line)</span></p>
<p><a href="https://github.com/jewlofthelotus/SassShop" target="_blank">Download the Slides + Project</a></p>
<p class="box--small"><a href="http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line" target="_blank">Command Line Tutorial</a></p>
</div>
</section>
<!-- Intro : Course -->
<!-- <section>
<img src="images/gdiaa.png" style="border: none; box-shadow: none;">
<div class="box--small">
<h3>Getting Sassy with CSS</h3>
<p><small>#SassShop</small></p>
</div>
</section> -->
<!-- Intro : GDI Welcome -->
<!-- <section>
<h3>Welcome!</h3>
<p class="box"><strong>Girl Develop It</strong> is here to empower and assist women interested in getting into and advancing in the tech industry through affordable and accessible programs.</p>
<div class="copy--small">
<h4 class="green">Some "rules"</h4>
<ul>
<li>We are here for you!</li>
<li>Every question is important.</li>
<li>Help each other.</li>
<li><strong>Have fun!</strong></li>
</ul>
</div>
</section> -->
<!-- Intro : About Me -->
<section>
<h2>Julie Cameron</h2>
<p class="box"><small><a href="http://juliecameron.com" target="_blank">JulieCameron.com</a> | <a href="http://twitter.com/jewlofthelotus" target="_blank">@JewlOfTheLotus</a> | <a href="mailto:[email protected]">[email protected]</a></small></p>
<div class="right">
<img src="images/julie.jpg" />
</div>
<ul class="left">
<li><strong>Co-Founder</strong> of <a href="http://gdiannarbor.com" target="_blank">GDI Ann Arbor</a></li>
<li><strong>Remote Frontender</strong> for <a href="http://articlate.com" target="_blank">Articulate</a></li>
<li><strong>Sassy CSS</strong> Fan</li>
<li><strong>Modular Architecture</strong> Proponent</li>
</ul>
<aside class="notes">
<ul>
<li>Working Remote</li>
<li>SlickQuiz</li>
<li>Full Time Sass for 1 year</li>
</ul>
</aside>
</section>
<!-- Intro : About You -->
<section>
<h3>Meet the team!</h3>
<p class="box box--top">What is <span class="yellow">your name</span>?</p>
<p class="box">What is your <span class="yellow">140 character</span> dev bio?</p>
<p class="box">What is your <span class="yellow">fave dev tool / plugin / blog / etc.</span>?</p>
<aside class="notes">
<p>Well you all rule because I love all cookies, my nickname as a child was "the cookie monster."</p>
</aside>
</section>
<!-- Intro : Course : Outline -->
<section>
<h2>Getting Sassy with CSS</h2>
<ol class="box broken">
<li>What is Sass</li>
<li>The Sass Workflow</li>
<li>Sass Basics</li>
<li class="break js-break-1day js-break-2day">Advanced Sass</li>
<li class="break js-break-1day">Media Queries</li>
<li>Modular Architecture</li>
<li>Libraries & Tools</li>
<li>Wrap-Up</li>
</ol>
</section>
<!-- Intro : Course : Project -->
<section>
<h2>The Project...</h2>
<div class="box--top left left-align copy--small" style="width: 45%;">
<p><strong>Client:</strong> <span class="green">Kittens "R" Us</span></p>
<p class="box--small"><strong>Description:</strong> A local adoption listing website for kitties in need of homes.</p>
<p><strong>Framework:</strong> HTML5 & CSS3</p>
<p class="box copy--small clear"><strong>Slides + Project</strong>: <a target="_blank" href="https://github.com/jewlofthelotus/SassShop">https://github.com/jewlofthelotus/SassShop</a></p>
</div>
<div class="box--small right" style="width: 45%;">
<img src="images/making-this-today.png" />
</div>
<aside class="notes">
<small>
<p>Nothing too special, just something to play around with - but feel free to go all out!</p>
<p>I HIGHLY recommend that you DL these slides and refer back to them as we're going through exercises</p>
<p>You're welcome to follow the examples exactly, or customize things as we go.</p>
<p>And Feel free to try things out as I'm presenting, I don't want you to feel like you need to wait for the exercise to experiment.</p>
</small>
</aside>
</section>
<!-- Intro : Project Setup : Develop It! -->
<section>
<h3>Project Setup <span class="yellow">Let's develop it!</span></h3>
<ol class="box list--tall">
<li>Download the slides.<br/><small><a href="https://github.com/jewlofthelotus/SassShop" target="_blank">https://github.com/jewlofthelotus/SassShop</a></small></li>
<li class="copy--small">Open the <code>exercises</code> directory in your <span class="green">text editor</span> of choice.<br/><small>The <code>exercises/kittens</code> directory is where we'll be doing our work.</small></li>
<li class="copy--small">Navigate to the <code>exercises/kittens</code> directory via the <span class="green">command line</span>.<br /><small>Run <code>sass -v</code> to verify that Sass is installed.</small></li>
<li class="copy--small">Open <code>exercises/kittens/index.html</code> in your <span class="green">browser</span>.<br /><small class="yellow">Yay, kittens!</small></li>
</ol>
<aside class="notes">
</aside>
</section>
</section>
<!-- SECTION 1 : WHAT IS SASS -->
<section>
<section>
<h2>Section I</h2>
<p>What is <strong class="blue">Sass</strong>?</p>
</section>
<!-- What Is Sass : The Trouble with CSS -->
<section>
<h3><span class="blue">WHY</span> The Trouble with CSS</h3>
<ul class="box">
<li>Websites are becoming increasingly <strong class="red">complex</strong>.</li>
<li>CSS is getting <strong class="red">harder</strong> to maintain.</li>
<li>Writing styles is often <strong class="red">tedious</strong> and <strong class="red">repetitive</strong>.</li>
<li><strong class="red">CSS can only do so much for us...</strong></li>
</ul>
<aside class="notes">
<ul>
<li>bigger, more modular, componentized</li>
<li>our needs for organization are increasing</li>
<li>repetition - think vendor prefixes, think linear gradients</li>
<li>CSS was designed to be a simple language - advanced features were left out in favor of adoptability</li>
</ul>
</aside>
</section>
<!-- What Is Sass : Enter Sass -->
<section>
<img class="img--bare" src="images/sass-logo.png" style="height: 300px;" />
<p class="box blue"><strong>S</strong>yntactically <strong>A</strong>wesome <strong>S</strong>tyle<strong>S</strong>heets</p>
<p>Like CSS, but <span class="yellow">AWESOME</span></p>
<aside class="notes">
</aside>
</section>
<!-- What Is Sass : Origins -->
<section>
<div class="left" style="width: 80%">
<h3>Sass Origins</h3>
<ul class="box">
<li><strong>2007:</strong> Designed by <a href="http://www.hamptoncatlin.com/" target="_blank">Hampton Catlin</a> (Haml)
</li>
<li class="box">Developed by <a href="http://nex-3.com/" target="_blank">Natalie Weizenbaum</a> and <a href="http://chriseppstein.github.io/" target="_blank">Chris Eppstein</a> (Compass)</li>
<li><strong>March 2014:</strong> <span class="yellow">Sass 3.3</span> was released!</li>
<li><strong>August 2014:</strong> <span class="yellow">Sass 3.4</span> was released!</li>
<li class="green">Pushing CSS ahead!</li>
</ul>
</div>
<div class="right" style="width: 20%;">
<img src="images/hampton-catlin.png" style="width: 100%;" /><br />
<img src="images/natalie-weizenbaum.jpg" style="width: 100%;" /><br />
<img src="images/chris-eppstein.jpg" style="width: 100%;" />
</div>
<aside class="notes">
<p>Sass Trifecta of Awesome</p>
<p>Tools like Sass, Less and Stylus have live-tested features and impelemnations that will likely inspire features in future CSS specifications.</p>
<p>So let's get a taste of what Sass can do for us by digging into one of CSSs pain-points: repetition.</p>
</aside>
</section>
<!-- What Is Sass : Repetition -->
<section>
<h3>Repetition</h3>
<div class="left" style="width: 50%">
<pre><code class="css">
.header {
background-color: #531946;
border-radius: 5px;
padding: 5px 20px;
}
.header a {
color: #fff;
}
.header a:hover {
color: #095169;
}
.footer {
background-color: #30162B;
color: #fff;
border-radius: 5px;
padding: 5px 20px;
}
.footer a {
color: #095169;
}
.footer a:hover {
color: #fff;
}
.feature a {
background-color: #30162B;
color: #fff;
border-radius: 5px;
padding: 5px 20px;
}
.feature a:hover {
color: #531946;
}
.content {
background-color: #fff;
color: #222;
border-radius: 5px;
padding: 5px 20px;
}
</code></pre>
</div>
<div class="box right left-align" style="width: 47%">
<h4 class="green">DRY</h4>
<p class="green">Don't Repeat Yourself</p>
<div class="box">
<p class="red fragment">HEX Colors</p>
<p class="red fragment">Border Radius + Padding</p>
<p class="red fragment">Selectors</p>
</div>
</div>
<aside class="notes">
<p>development principle aimed at reducing repetition</p>
<p>HINT: the syntax highlighting might give you a few ideas</p>
<p>Colors >> Padding >> Selectors</p>
<p>So let's see what Sass can do for us in these scenarios, starting with colors...</p>
</aside>
</section>
<!-- What Is Sass : Repetition : Colors -->
<section>
<h3><span class="blue">Repetition</span> Colors</h3>
<div class="box left" style="width: 49%">
<h4>CSS</h4>
<pre><code class="css">
.header {
background-color: #531946;
}
.header a {
color: #fff;
}
.header a:hover {
color: #095169;
}
.footer {
background-color: #30162B;
color: #fff;
}
.footer a {
color: #095169;
}
.footer a:hover {
color: #fff;
}
.feature a {
background-color: #30162B;
color: #fff;
}
.feature a:hover {
color: #531946;
}
.content {
background-color: #fff;
color: #222;
}
</code></pre>
</div>
<div class="fragment box right" style="width: 49%">
<h4 class="green">Sass <span class="yellow">Variables</span></h4>
<pre><code class="scss">
$white: #ffffff;
$black: #222222; // NOT! ;)
$eggplant: #531946;
$eggplantDark: #30162B;
$teal: #095169;
.header {
background-color: $eggplant;
}
.header a {
color: $white;
}
.header a:hover {
color: $teal;
}
.footer {
background-color: $eggplantDark;
color: $white;
}
.footer a {
color: $teal;
}
.footer a:hover {
color: $white;
}
.feature a {
background-color: $eggplantDark;
color: $white;
}
.feature a:hover {
color: $eggplant;
}
.content {
background-color: $white;
color: $black;
}
</code></pre>
</div>
<aside class="notes">
<p>No one wants to remember #531946</p>
<p>Wouldn't it be nice if we had a way to store and reference our colors?</p>
</aside>
</section>
<!-- What Is Sass : Repetition : Border Radius + Padding -->
<section>
<h4><span class="blue">Repetition</span> Border Radius + Padding</h4>
<div class="box left" style="width: 49%">
<h4>CSS</h4>
<pre><code class="css">
.header {
border-radius: 5px;
padding: 5px 20px;
/* ... */
}
.footer {
border-radius: 5px;
padding: 5px 20px;
/* ... */
}
.feature a {
border-radius: 5px;
padding: 5px 20px;
/* ... */
}
.content {
border-radius: 5px;
padding: 5px 20px;
/* ... */
}
</code></pre>
</div>
<div class="box fragment right" style="width: 49%">
<h4 class="green">Sass <span class="yellow">Mixins</span></h4>
<pre><code class="scss">
@mixin rounded-box {
border-radius: 5px;
padding: 5px 20px;
}
.header {
@include rounded-box;
// ...
}
.footer {
@include rounded-box;
// ...
}
.feature a {
@include rounded-box;
// ...
}
.content {
@include rounded-box;
// ...
}
</code></pre>
</div>
<aside class="notes">
<p>It looks like we've got a default box style</p>
<p>What if we could set those defaults in one place and reference it elsewhere?</p>
</aside>
</section>
<!-- What Is Sass : Repetition : Selectors -->
<section>
<h3><span class="blue">Repetition</span> Selectors</h3>
<div class="box left" style="width: 49%">
<h4>CSS</h4>
<pre><code class="css">
.header {
/* ... */
}
.header a {
/* ... */
}
.header a:hover {
/* ... */
}
.footer {
/* ... */
}
.footer a {
/* ... */
}
.footer a:hover {
/* ... */
}
.feature a {
/* ... */
}
.feature a:hover {
/* ... */
}
.content {
/* ... */
}
</code></pre>
</div>
<div class="box fragment right" style="width: 49%">
<h4 class="green">Sass <span class="yellow">Nesting</span></h4>
<pre><code class="scss">
.header {
// ...
a {
// ...
&:hover {
// ...
}
}
}
.footer {
// ...
a {
// ...
&:hover {
// ...
}
}
}
.feature a {
// ...
&:hover {
// ...
}
}
.content {
// ...
}
</code></pre>
</div>
<aside class="notes">
<p>What if I want to change <code>.header</code> to <code>.banner</code>? I have to edit it everywhere</p>
<p>What if we had a way of only referencing these repeated selectors once?</p>
<p>What if we could nest our selectors just like we can in our HTML?</p>
</aside>
</section>
<!-- What Is Sass : Repetition : Recap -->
<section>
<h3><span class="blue">RECAP</span> Repetition</h3>
<div class="box left" style="width: 49%">
<h4>CSS</h4>
<pre><code class="css">
.header {
background-color: #531946;
border-radius: 5px;
padding: 5px 20px;
}
.header a {
color: #fff;
}
.header a:hover {
color: #095169;
}
.footer {
background-color: #30162B;
color: #fff;
border-radius: 5px;
padding: 5px 20px;
}
.footer a {
color: #095169;
}
.footer a:hover {
color: #fff;
}
.feature a {
background-color: #30162B;
color: #fff;
border-radius: 5px;
padding: 5px 20px;
}
.feature a:hover {
color: #531946;
}
.content {
background-color: #fff;
color: #222;
border-radius: 5px;
padding: 5px 20px;
}
</code></pre>
</div>
<div class="box right" style="width: 49%">
<h4 class="yellow">Sass</h4>
<pre><code class="scss">
$white: #ffffff;
$grey: #222222;
$eggplant: #531946;
$eggplantDark: #30162B;
$teal: #095169;
// Mixins
@mixin rounded-box {
border-radius: 5px;
padding: 5px 20px;
}
// Site Stylez
.header {
@include rounded-box;
background-color: $eggplant;
a {
color: $white;
&:hover { color: $teal; }
}
}
.footer {
@include rounded-box;
background-color: $eggplantDark;
color: $white;
a {
color: $teal;
&:hover { color: $white; }
}
}
.feature a {
@include rounded-box;
background-color: $eggplantDark;
color: $white;
&:hover { color: $eggplant; }
}
.content {
@include rounded-box;
background-color: $white;
color: $grey;
}
</code></pre>
</div>
<aside class="notes">
<p>Colors (vars), Border Radius + Padding (mixin), Selectors (nesting)</p>
</aside>
</section>
<!-- What Is Sass : Recap -->
<section>
<h3><span class="blue">RECAP</span> Why Sass?</h3>
<ul class="box">
<li>Reduced <span class="green">complexity</span>.</li>
<li>Increased <span class="green">maintainability</span>.</li>
<li>Minimized <span class="green">repetition</span>.</li>
<li><span class="yellow">Supercharged CSS!</span></li>
</ul>
<aside class="notes">
<p>Alright, so now that we've gotten a taste of it in action, let's get an official definition</p>
</aside>
</section>
<!-- What Is Sass : What is Sass? -->
<section>
<h3>What is Sass?</h3>
<p class="box">Sass is an <span class="yellow">extension of CSS</span> that adds power and elegance to the basic language. It allows you to use <span class="green">variables</span>, <span class="green">nested rules</span>, <span class="green">mixins</span>, <span class="green">inline imports</span>, and <span class="green">more</span>, all with a <span class="yellow">fully CSS-compatible syntax</span>. Sass helps keep large stylesheets well-<span class="green">organized</span>, and get small stylesheets up and running quickly...</p>
<cite>~ <a href="http://sass-lang.com/documentation/file.SASS_REFERENCE.html" target="_blank">Sass Documentation</a></cite>
<aside class="notes">
<p>Any valid CSS file is a valid Sass file</p>
</aside>
</section>
<!-- What Is Sass : What is Sass? 3 -->
<section>
<h3>What is Sass?</h3>
<div class="left box" style="width: 49%;">
<p>CSS <span class="green">Extension</span></p>
<p class="fragment" data-fragment-index="2"><span class="yellow">SassScript</span> Language</p>
</div>
<div class="box right fragment" style="width: 49%;" data-fragment-index="1">
<p>CSS <span class="green">Preprocessor</span></p>
<p class="fragment" data-fragment-index="3">SassScript <span class="yellow">Interpreter</span></p>
</div>
<p class="fragment" style="font-size: 72px;" data-fragment-index="4">Sass <i class="fa fa-arrow-right blue"></i> CSS</p>
<aside class="notes">
<p>Sass is an extension of CSS, but we can't load Sass in the browser like we can CSS</p>
<p>May seem like 2 separate tools, but they're really just one, and more often then not, you'll hear them referred to as a singluar tool.</p>
</aside>
</section>
<!-- What is Sass : Syntax -->
<section>
<h3><span class="blue">Two</span> SassScript Syntaxes</h3>
<div class="left" style="width: 49%">
<p><span class="yellow">.scss (Sassy CSS)</span><br /><small>Default syntax; Valid CSS == Valid SCSS</small></p>
<pre><code class="scss">
$black: #000;
$white: #fff;
.this {
color: $black;
background: $white;
}
.that {
color: $white;
background: $black;
}
.this, .that {
display: block;
&:hover {
border: 1px solid;
}
}
</code></pre>
</div>
<div class="right" style="width: 49%">
<p><span class="green">.sass (Indented)</span><br /><small>Original syntax, still supported; Haml-esque</small></p>
<pre><code class="sass">
$black: #000
$white: #fff
.this
color: $black
background: $white
.that
color: $white
background: $black
.this, .that
display: block
&:hover
border: 1px solid
</code></pre>
</div>
<aside class="notes">
<p>Because valid CSS is also valid SCSS, getting started with Sass is as easy as changing the file extension.</p>
<p>Start slow, add in features as you learn / get more comfortable.</p>
</aside>
</section>
</section>
<!-- SECTION 2 : SASS WORKFLOW -->
<section>
<section>
<h2>Section II</h2>
<p>The Sass <span class="blue">Workflow</span></p>
</section>
<!-- SASS Workflow : Installation -->
<section>
<h3>Sass <span class="blue">Installation</span></h3>
<div class="box">
<h4 class="green">Ruby</h4>
<p>OS X? Lucky you, it's preinstalled!</p>
<p>Windows? Try <a href="http://rubyinstaller.org/">RubyInstaller</a>.</p>
</div>
<div class="box">
<h4 class="yellow">Sass</h4>
<p><code><strong>$</strong> gem install sass</code></p>
</div>
</section>
<!-- SASS Workflow : Running -->
<section>
<h3><span class="blue">Running</span> Sass</h3>
<p>(aka Compiling Sass)</p>
<p class="box--small" style="font-size: 72px;">Sass <i class="fa fa-arrow-right yellow"></i> CSS</p>
<p><code><strong>$</strong> sass source.scss output.css</code></p>
<p class="box"><code><strong>$</strong> sass source_dir output_dir</code></p>
<aside class="notes">
<p>So let's get a more visual representation...</p>
</aside>
</section>
<!-- SASS Workflow : Running -->
<section>
<h3><span class="blue">Running</span> Sass</h3>
<div class="box">
<ul>
<li><strong>kittens</strong>
<ul>
<li>index.html</li>
<li>sass
<ul>
<li class="green">application.scss</li>
</ul>
</li>
<li>css
<ul class="fragment">
<li class="yellow">application.css</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div><code><strong>$</strong> sass sass/screen.scss css/screen.css</code></div>
<aside class="notes">
<p>At this point you might be thinking</p>
<p>Well gosh, do I need to run this command EVERY single time I make a change?</p>
<p>And the answer is of course not! That's what watching is for!</p>
</aside>
</section>
<!-- SASS Workflow : Watching -->
<section>
<h3>Sass Is <span class="blue">Watching</span> You...</h3>
<div class="box"><code><strong>$</strong> sass <span class="green">--watch</span> source.scss:output.css</code></div>
<div class="yellow">This is the best thing EVER.</div>
<div class="box"><span class="red">Gotchya:</span> Colon vs. Space</div>
<aside class="notes copy--small">
<ul>
<li>works with single files and entire directories</li>
<li>...let's look at some more commands</li>
</ul>
</aside>
</section>
<!-- SASS Workflow : Other Commands -->
<section>
<h3>More Sass <span class="blue">Options</span></h3>
<div class="box--small">
<code class="copy--small"><strong>$</strong> sass source.scss output.css</code>
<div><small>Compile <code>source.scss</code> to <code>output.css</code>. <span class="red">Gotchya:</span> will fail if output directory doesn't exist.</small></div>
</div>
<div>
<code class="copy--small"><strong>$</strong> sass <span class="green">--update</span> source.scss<span class="yellow">:</span>output.css</code></code>
<div><small>Compile <code>source.scss</code> to <code>output.css</code>. Will create directory if it doesn't exist.</small></div>
</div>
<div class="box--small">
<code class="copy--small"><strong>$</strong> sass <span class="green">--watch</span> source.scss<span class="yellow">:</span>output.css</code>
<div><small>Watch <code>source.scss</code> for changes. Will create directory if it doesn't exist.</small></div>
</div>
<div>
<code class="copy--small"><strong>$</strong> sass <span class="green">--style expanded</span> source.scss<span class="yellow">:</span>output.css</code></code>
<div><small>Adjusts output format. Options: <strong>nested</strong>, expanded, compact, compressed</small></div>
</div>
<aside class="notes">
<p>I'm going to get into some code to explain the style option more...</p>
</aside>
</section>
<!-- SASS Workflow : Demo -->
<section>
<h3><span class="blue">Demo</span> Sass Workflow</h3>
<aside class="notes">
<p>Exercise - Section 2</p>
<ul>
<li>sass sass/screen.scss css/screen.css</li>
<li>sass --update sass/screen.scss:css/screen.css</li>
<li>sass --watch sass/screen.scss:css/screen.css</li>
<li>sass --style expanded sass/screen.scss:css/screen.css</li>
<li>sass --style compact sass/screen.scss:css/screen.css</li>
<li>sass --style compressed sass/screen.scss:css/screen.css</li>
</ul>
</aside>
</section>
<!-- SASS Workflow : Source Maps -->
<section>
<h3>Sass <span class="blue">Sourcemaps</span></h3>
<p class="box--small copy--small">Sourcemaps tell browsers where the Sass that generated the CSS is.<br/>
<small class="green">You must enable sourcemaps in the browser to use this feature.</small></p>
<img src="images/chrome-settings.png" />
<img src="images/css-sourcemaps.png" />
<aside class="notes">
<p>LET'S ALL DO THIS TOGETHER!</p>
<p>"Auto reload generated CSS" is a bit beyond our scope for today, but it will let you make CSS changes in the browser and have them saved back to your Sass code.</p>
</aside>
</section>
<!-- Sass Workflow : Develop It! -->
<section>
<h3>Workflow <span class="yellow">Let's develop it!</span></h3>
<ol class="left copy--small " style="width: 60%;">
<li class="box--small">Open up your <strong>kittens</strong> project</li>
<li>Open <code>index.html</code> in the broswer<br />
<small>Optionally enable <strong>LivePage</strong>**</small>
</li>
<li>Copy <code>css/application.css</code> to <code>sass/application.scss</code><br />
<small><code>mkdir sass && cp css/application.css sass/application.scss</code></small>
</li>
<li>Remove <code>application.css</code> <br />
<small><code>rm css/application.css</code></small>
</li>
<li>Run Sass (on one line): <br />
<small><code>sass --watch --style expanded sass/application.scss:css/application.css</code><br /></small>
</li>
<li class="box--small">Checkout your page in the browser to see your new <em class="yellow">sassified stylez</em>!</li>
</ol>
<ul class="box right" style="width: 35%;">
<li><strong>kittens</strong>
<ul>
<li>index.html</li>
<li><strong>css</strong>
<ul>
<li class="yellow">application.css</li>
</ul>
</li>
<li><strong>sass</strong>
<ul>
<li class="green">application.scss</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="right" style="width: 35%;">
<small>** You will need to enable "Allow access to file URLs" for LivePage in <a target="_blank" href="chrome://extensions/">chrome://extensions</a></small>
</div>
</section>
</section>
<!-- BREAK TIME -->
<section class="js-2day">
<h3>Break Time!</h3>
<p class="box">Enjoy some snacks!<br /><small class="hide">courtesy of <strong class="js-sponsor-name"></strong></small></p>
<img src="images/banana-cat.gif" />
</section>
<!-- SECTION 3 : SASS BASICS -->
<section>
<section>
<h3>Section III</h3>
<p>Sass <span class="blue">Basics</span></p>
<aside class="notes">
<p>Alright, so now that we know generally what Sass is and how it works</p>
<p>let's get into the basics</p>
</aside>
</section>
<!-- Sass Basics : Core Features -->
<section>
<h3>Sass Basics</h3>
<ol class="box broken">
<li>Nesting</li>
<li class="break">Variables</li>
<li class="break">Imports & Organization</li>
</ol>
<aside class="notes">
<p>Imports are critical for a modular and organized architecture</p>
</aside>
</section>
<!-- Sass Basics : Nesting -->
<section>
<h3><span class="blue">Sass Basics</span> Nesting</h3>
<div class="box copy--small">
<p><span class="green">HTML has a clear hierarchy</span> - elements are <em class="yellow">nested</em>.</p>
<p>We can apply the same concept in Sass.</p>
</div>
<div class="left" style="width: 49%">
<h4>HTML</h4>
<pre class="html"><code class="html">
<nav class="navigation">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</code></pre>
</div>
<div class="right" style="width: 49%">
<h4 class="yellow">Sass</h4>