-
Notifications
You must be signed in to change notification settings - Fork 0
/
presentation.html
1051 lines (1005 loc) · 29.6 KB
/
presentation.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>Level Up Your Style</title>
<meta name="description" content="">
<meta name="author" content="Patricia Cifra">
<meta name="author" content="Ashley Price">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="icon" href="images/favicon.ico">
<link rel="stylesheet" href="reveal/css/reveal.css">
<link rel="stylesheet" href="reveal/css/theme/sky.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="reveal/lib/css/zenburn.css">
<!-- For the slides -->
<link rel="stylesheet" href="css/slides.css">
<link rel="stylesheet" href="style/stylesheet/sass_presentation.css">
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="reveal/css/print/pdf.css" type="text/css" media="print">
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening slide -->
<section>
<aside class="notes">
<ul>
<li>Hi Everyone, I'm _____ and this is ____</li>
<li>We work at Spanning Cloud Apps</li>
<li>Spanning does:</li>
<li>We were inspired by our experiencing converting Spanning's flagship application from CSS to Sass</li>
<li>We'd like to show what it's like to update a large single page application from CSS to Sass and some of the things we encountered along the way</li>
</ul>
Structure of our presentation:<ul>
<li>Brief overview of Sass for those who don't know it</li>
<li>An overview highlighting the pieces we leveraged for those that do<li>
<li>A look into the specific issues we had to tackle with an Enterprise app</li>
</ul>
Our Theme: <ul>
<li> RPG level grind, quest chain, leveling</li>
</ul>
</aside>
<img class="title_slide" src="images/level_up.gif">
<p class="blur">your style</p>
<p class="title-text">your style</p>
<div class="presenters">
<div class="first-presenter">
<p>Patty Cifra</p>
<p>@<span class="emph">pncifra</span></p>
</div>
<p>Presented by</p>
<div class="second-presenter">
<p>Ashley Price</p>
<p>@<span class="emph">classicallygeek</span></p>
</div>
</div>
</section>
<!-- Section 1: Why Convert -->
<section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Why Use a <span class="emph">Pre-processor?</span></h3>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Pros:</h3>
<ul>
<li>
It will make your CSS DRY (Code reuse across multiple projects)
</li>
<li>
Maintainability
</li>
<li>
Organized
</li>
<li>
Saves you time (mixins, variables, reduced redundancy)
</li>
<li>
Frameworks (level up your CSS, compass)
</li>
</ul>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3> Cons: </h3>
<p>This can take a <span class="emph">lot</span> of time</p>
<img class="teamwork" src="images/teamwork_mario.gif">
<p>Additionally, this will fail if your <span class="emph">entire</span> team isn't onboard</p>
</section>
</section>
<section>
<section>
<aside class="notes">
PATTY
- Compass
- variables were similar
- Sass used ruby
- syntax and structure seemed more intuitive for Sass
</aside>
<h3>Why <span class="emph">Sass</span> and moreso why <span class="emph">SCSS</span></h3>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Sass</h3>
<ul>
<li>
Indented syntax of Sass was inherited from HAML
</li>
<li>
Sass doesn't complain about missing semi-colons
</li>
</ul>
</section>
<section>
<aside class="notes">
PATTY
sass syntax uses indentation rather than brackets to indicate nesting of selectors, and newlines rather than semicolons to separate properties.
more syntactically concise.
</aside>
<h3>EXAMPLE</h3>
<pre>
<code class="sass scss">
=border-radius($radius)
-webkit-border-radius: $radius
-moz-border-radius: $radius
-ms-border-radius: $radius
border-radius: $radius
.box
+border-radius(10px)
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3> SCSS </h3>
<ul>
<li>
Superset of CSS. Contains all the features of CSS and features of Sass as well
</li>
<li>
encourages proper nesting of rules
</li>
<li>
encourages more modular code with @extend
</li>
<li>
existing tools often work with SCSS
</li>
<li>
integration with an existing CSS codebase is much easier
</li>
<li>
SCSS provides a much lower barrier to entry
</li>
</ul>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>EXAMPLE</h3>
<pre>
<code class="sass scss">
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
.box { @include border-radius(10px); }
</code>
</pre>
</section>
</section>
<!-- Section 3: Why not use an automatic conversion tool? -->
<section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Why not an automatic <span class="emph">conversion</span> tool?</h3>
</section>
<section>
<aside class="notes">
ASHLEY<br>
http://stackoverflow.com/questions/13450355/css-to-sass-or-less-conversion
</aside>
<p>Conversion tools exist that can turn your CSS files into sass files. They can also format them for into beauitfully tabbed and spaced files, but there isn't a tool that can <span class="emph">refactor</span> your existing CSS into well-structured Sass.</p>
</section>
</section>
<!-- Section 4: Getting Started -->
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Your first <span class="emph">Quest</span></h3>
<img src="images/navigate_the_Darkness.gif">
<p>We'll help you navigate the darkness and get setup to go</p>
</section>
<!-- Section 4.1: Organizing your File Structure -->
<section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Leverage imports and partials</h3> to create a <span class="emph">modularized</span> code base for maintainability
</section>
<section>
<aside class="notes">
PATTY <br>
With traditional CSS, modularisation is implemented through classes and ids but Sass allows us to take this idea one step further through the use of functions and partials.
<ul>
<li>The idea here is that each module/action within the app has their own Sass file.</li>
<li>The idea is that anything that can made modular should be poosed int a partial so it can be reused anywhere. </li>
<li>Inside which only partials and mixins needed for taht module will be imported. Similar to a well structured webapp where only the required functions and classes are imported so performance is optimised.</li>
</ul>
</aside>
<h3>Partials</h3>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Be <span class="emph">Structured</span> </h3>
<pre>
<code class="sass scss">
/web/sass
->home.scss
->articlesSelected.scss
->articlesLanding.scss
/web/sass/mixins
->_colours.scss
->_typography.scss
->_layout.scss
/web/sass/partials
->_base.scss
->_reset.scss
->_layout.scss
->_buttons.scss
->_comments.scss
->_tooltip.scss
</code>
</pre>
<aside class="notes">
PATTY<br>
PARTIALS:<ul>
<li>you can create partial Sass files that contain little snippets of CSS taht you can include in other Sass files. </li>
<li>This is a great way to modularize your CSS and help keep thigns easier to maintain. A partial is simply a Sass file named with a
leading underscore. </li>
<li>The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file.</li>
<li>Sass partials are used with the @import directive.</li>
</ul>
</aside>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>@Import</h3>
<pre>
<code class="sass scss">
@import "mixins/colors";
@import "mixins/typography";
@import "mixins/functions";
@import "partials/reset";
@import "partials/base";
@import "partials/layout";
@import "partials/buttons";
</code>
</pre>
<aside class="notes">
PATTY <br>
IMPORT:
CSS has an import option that lets you split your CSS into smaller, more maintainable portions. The only drawback is that each
time you use @imporrt in CSS it creates another HTTP request. Sass bulds on top of the current CSS @import but instead of
requiring an HTTP request, Sass will take the file you want to import and combine it with the file you're importing into
so you can serve a single CSS file to the web broweser.
</aside>
</section>
</section>
<section>
<section>
<aside class="notes">
ASHLEY<br>
<ul>
<li>What is compass?</li>
<li>Experience cleaner markup without presentational classes.</li>
<li>Compass mixins make CSS3 easy</li>
</ul>
</aside>
Join a <span class="emph">guild</span> called <h3>Compass</h3>
<img src="images/compass.jpg">
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>The Compass <span class="emph">Lifestyle</span></h3>
<ul>
<li>
create (create a new compass project)
</li>
<li>
init (initialize an existing project to work with compass)
</li>
<li>
install (install a pattern from an extension into a project)
</li>
<li>
compile (compile the project's sass files into CSS)
</li>
<li>
watch (watch the project for changes and compile whenever it does)
</li>
<li>
config (emit a configuration file at the location specified)
</li>
<li>
validate (validate the generated CSS)
</li>
</ul>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Example</h3>
<pre>
<code class="sass scss">
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "../"
css_dir = "style"
sass_dir = "sass"
images_dir = "image"
javascripts_dir = "javascripts"
# output_style = :expanded or :nested or :compact or :compressed
output_style = :compressed
# To enable relative paths to assets via compass helper functions.
# relative_assets = true
line_comments = false
</code>
</pre>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Your Compass Toolbox</h3>
<img class="compass-img" src="images/tools.gif">
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3> Box Shadow </h3>
<pre>
<code class="sass scss">
// Default single box shadow
#box-shadow-default {
@include single-box-shadow;
}
// Box shadow with custom settings
#box-shadow-custom {
@include box-shadow(red 2px 2px 10px);
}
#box-shadow-custom-multiple {
@include box-shadow(rgba(blue, 0.4) 0 0 25px, rgba(green, 0.2) 0 0 3px 1px inset);
}
</code>
</pre>
</section>
<section>
<aside class="notes">
ASHLEY<br>
Older versions of MS IE have their own special approach to creating opacity and this one line will take care of it all
</aside>
<h3> Opacity </h3>
<pre>
<code class="sass scss">
#opacity-10 {
@include opacity(0.1);
}
#opacity-20 {
@include opacity(0.2);
}
#opacity-50 {
@include opacity(0.5);
}
#opaque {
@include opaque;
}
</code>
</pre>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3> Border Radius </h3>
<pre>
<code class="sass scss">
#border-radius {
@include border-radius(25px);
}
#border-radius-top-left {
@include border-top-left-radius(25px);
}
#border-radius-top-right {
@include border-top-right-radius(25px);
}
#border-radius-bottom-left {
@include border-bottom-left-radius(25px);
}
</code>
</pre>
</section>
</section>
<!-- Section: 5: First Pass -->
<section>
<aside class="notes">
ASHLEY
</aside>
<img class="spellbook-title" src="images/spellbook.png">
<div><img class="spellbook-img" src="images/magic_missile.gif"></div>
</section>
<section>
<section>
<aside class="notes">
PATTY<br>
When use variables?<br>
Use a variable when you have a single value you'd like to store
</aside>
<h3> Variables</h3>
<p>Colors, Fonts, <span class="emph">etc.</span></p>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Example</h3>
<pre>
<code class="sass scss">
$gothamRounded: 'Gotham Rounded A', 'Gotham Rounded B', arial narrow;
$helvetica: Helvetica Neue, Helvetica, Arial, Sans Serif;
$arial: Arial, sans-serif;
$tahoma: tahoma, arial, sans-serif;
$primaryFont: 'Open Sans', sans-serif;
$groupTitles: $gothamRounded;
$leagueGothic: league-gothic, arial narrow, sans-serif;
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY<br>
50 shades of grey
</aside>
<h3> Easy </h3>
<pre>
<code class="sass scss">
$yellow-green: #b0eb00;
$red: #b30015;
$blue: #2a00b3;
$grey: #595959;
$dark-grey: #363636;
$light-grey: #a6a6a6;
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY<br>
50 shades of grey
</aside>
<h3> Uhhm.. </h3>
<pre>
<code class="sass scss">
$grey-lightest: #EEEEEE;
$grey-lighter-two: #DDDDDD;
$grey-lighter: #D9D9D9;
$grey-light: #CCCCCC;
$grey-med-light: #C4C4C4;
$grey-med: #999999;
$grey-med-dark: #666666;
$grey-dark: #4F4F4F;
$grey-darkest: #333333;
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY<br>
50 shades of grey
</aside>
<h3> Abstract Out </h3>
<pre>
<code class="sass scss">
$background-color: #b0eb00;
$error-color: #b30015;
$anchor-color: #2a00b3;
$anchor-hover-color: #0077b3;
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY<br>
50 shades of grey
</aside>
<h3> Getting Creative </h3>
<pre>
<code class="sass scss">
$graphite: #999999;
$slate: #989898;
$mouse: #A1A1A1;
$smog: #D0D0D0;
$smokey: #ECECEC;
$asphalt: #404040;
$cement: #A0A0A0;
$pavement: #A8A8A8;
$cloud: #F7F7F7;
$mist: #E4E4E4;
$elephant: #6E6E6E;
$chalk: #E2E2E2;
$evil: #5C5C5C;
$hippo: #9F9F9F;
$gunk: #CBCBCB;
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY<br>
50 shades of grey
</aside>
<h3> Also </h3>
<pre>
<code class="sass scss">
$grey-light-border: #F4F4F4;
$grey-med-border: #DDDEDF;
$grey-dark-border: #B5B8C8;
</code>
</pre>
</section>
</section>
<section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Nesting</h3>
<p>A spell for <span class="emph">organizing</span> and <span class="emph">structuring</span> your code
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
Most importantly it has the power to <span class="emph">stop</span> you from <span class="emph">repeating</span> the same lines over and over.
<pre><code class="sass scss">
.sca-buy-container {
@include border-radius(4px);
background-color: $bright-red;
color: $white;
.sca-buy-header,
.sca-buy-subtext,
.sca-buy-link {
font-weight: bold;
}
.sca-buy-header {
font-size: 1.2em;
}
}
</code></pre>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Beware</h3>
<p>Potential <span class="emph">Pit Falls</span> include: </p>
<img class="pit-falls-img" src="images/pit_falls.gif">
<p class="pit-falls-text" >Non-resuable code due to extremely specific selectors spawned by too much nesting and mimicing your DOM structure.</p>
</section>
</section>
<section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>URL-Helpers</h3>
</section>
<section>
<aside class="notes">
ASHLEY<br>
These url helpers isolate your stylesheets from environmental differences. They allow you to write the same stylesheets and use them locally without a web server, and then change them to using asset hosted in production. They might also insultaet you against some code reorganization changes.
These url helpers isolate your stylesheets from environmental differences. They allow you to write the same stylesheets and use them locally without a web server, and then change them to using asset hosted in production. They might also insultate you against some code reorganization changes.
</aside>
<img class="heart_break_img" src="http://media.giphy.com/media/SIPIe590rx6iA/giphy.gif">
<p class="heart_break_words"><span class="emph">Seperate</span> your styelsheets from your environment.</p>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<p>Your config.rb file will set up the path to image assets.</p>
<pre><code class="sass scss">
images_dir = "image"
</code></pre>
<p>And in your SCSS file you can now use "image-url" helper</p>
<pre><code class="sass scss">
.sca-credit-card-img {
background: image-url('creditcard.svg') right no-repeat;
background-size: contain;
}
</code></pre>
</section>
</section>
<section>
<section>
<aside class="notes">
PATTY<br>
Mixins always compile to CSS rules where they appear in code. Where an @extend generates more selectors, @mixin always generates more rules.
This is why for static rules it is often (not always) less bloaty to use @extend.<br>
As a rule of thumb, I only use mixins to do "mathy" things. "If it doesn't need to pass variable, it doesn't need to be a mixin" is my motto
</aside>
<h3>Mixins</h3>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Example</h3>
<pre>
<code class="sass scss">
@mixin down-arrow($color, $size) {
content: ' ';
border-style: solid;
border-width: $size $size 0 $size;
border-color: $color transparent transparent transparent;
}
@mixin up-arrow($color, $size) {
content: ' ';
border-style: solid;
border-width: 0 $size $size $size;
border-color: transparent transparent $color transparent;
}
</code>
</pre>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3><span class="emph">Another</span> Example</h3>
<pre>
<code class="sass scss">
@mixin gotham-rounded-font($size) {
font-family: $gothamRounded;
font-style: normal;
font-size: $size;
}
@mixin primary-font($size) {
font-size: $size;
font-family: $primaryFont;
}
@mixin arial($size) {
font-family: $arial;
font-size: $size;
}
</code>
</pre>
</section>
</section>
<section>
<section>
<aside class="notes">
PATTY <br>
Use @extend when you want to store multiple static properties and pass them to selectors
</aside>
<h3>Extends</h3>
</section>
<section>
<h3>Example</h3>
<pre>
<code class="sass scss">
.sca-checkmark {
background-position: center;
background-repeat: no-repeat;
background-size: 14px auto;
margin: 0 10px 0 10px;
}
.sca-checkmark-blue {
@extend .sca-checkmark;
background-image: image-url('checkmark_blue.svg');
}
.sca-checkmark-grey {
@extend .sca-checkmark;
background-image: image-url('checkmark_grey.svg');
}
</code>
</pre>
</section>
</section>
<section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Mixins vs Extends</h3>
While an @extend generates more <span class="emph">selectors</span>, @mixin always generates more <span class="emph">rules</span>.
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>@extend</h3>
<pre>
<code class="sass scss">
.test {
color: blue;
}
.test2 {
@extend test;
}
</code>
</pre>
CSS output:
<pre>
<code class="sass scss">
.test, .test2 {
color: blue;
}
</code>
</pre>
<aside class="notes">
PATTY
Notice: it doesn't "fetch" the style from .boom, instead it commma separates the original selector. It applies the styles to both more efficeintly.
</aside>
</section>
<section>
<aside class="notes">
PATTY
</aside>
<h3>Selector Inheritance</h3>
<pre>
<code class="sass scss">
.error {
border: 1px #f00;
}
.error.intrusion {
font-size: 1.3em;
}
.badError {
@extend .error;
border-width: 3px;
}
</code>
</pre>
CSS output:
<pre>
<code class="sass scss">
.error, .badError {
border: 1px #f00;
}
.error.intrusion, .badError.intrusion {
font-size: 1.3em;
}
.badError {
border-width: 3px;
}
</code>
</pre>
</section>
<section>
<h3>@mixin</h3>
<pre>
<code class="sass scss">
@mixin test {
color: red;
}
.test1 {
@include test;
}
.test2 {
@include test;
}
</code>
</pre>
CSS output
<pre>
<code class="sass scss">
.test1 {
color: red;
}
.test2 {
color: red;
}
</code>
</pre>
<aside class="notes">
PATTY<br>
@mixin fetches and inserts. Though not as efficient it can take parameters and process/use them in the output.
Note Sass also extends all nested selectors as well:
</aside>
</section>
</section>
<!-- Section 6: Special Concerns for Enterprise Applications -->
<section class="foes">
<aside class="notes">
ASHLEY
</aside>
<h3 class="foes-label"><span class="emph">Enterprise </span>Foes</h3>
<img class="foes-img" src="images/bowser_fire.gif">
</section>
<section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Working with <span class="emph">frameworks</span></h3>
<p>Robust frameworks are very popular for larger web applications and introduce a number of hurdles.</p>
<img src="images/mario_jump_over_fire.gif">
<p>Let's take a look at some enemies we ran into and how we took them down.</p>
</section>
<section>
<aside class="notes">
ASHLEY<br>
Did not use a theme builder because our designers made up a lot of components. e.g. date picker
</aside>
Giant Amounts of CSS provided that you will be specifying/writing over
<pre><code class="sass scss">
.x-property-grid .x-grid-row .x-grid-property-name .x-grid-cell-inner,
.x-property-grid .x-grid-row-over .x-grid-property-name .x-grid-cell-inner {
padding-left: 12px;
background-image: url('../../resources/themes/grid/property-cell-bg.gif');
background-repeat: no-repeat;
background-position: -16px 2px;
}
</code></pre>
</section>
</section>
<section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Mini-<span class="emph">boss</span>:</h3>
<h4 style="float: left">Overhauling the look of Framework components</h4>
<img src="images/rhino_boss.gif">
<h4>Based on a true story</h4>
</section>
<section>
<aside class="notes">
ASHLEY
</aside>
<h3>Designers visited the <span class="emph">magical</span> fairy cave of inspiration</h3>
<img src="images/zelda_fairy.gif">
</section>
<section>
<aside class="notes"> ASHLEY</aside>
<p>They invented the <span class="emph">Batch Picker</span></p>
<img src="images/batch_picker_dream.png">
</section>
<section>
<aside class="notes">
ASHLEY<br>
Why Not write our own? <br>
It was still worth leveraging the sencha datepicker for the date math, general built-in structure of events that occurred during month navigation and date selection
</aside>
<p>To make their dreams come true, we create a custom component out of ExtJS parts</p>
<img src="images/sencha_toolbar.png">
<img src="images/sencha_date_picker.png">
<p>But we needed to <span class="emph">overhaul</span> the entire look of the component</p>
</section>
<section>
<aside class="notes">
ASHLEY <br>
We nested 5 times for .x-btn-icon.sca-calendar-img.batch-picker-icon. It's under
.sca-batch-picker<br>
.date-display<br>
&.all-dates<br>
&.x-btn-over<br>
<br>
We had specifiers that followed the generated DOM: <br>
&.x-toolbar.x-box-item.x-toolbar-item.x-toolbar-default.x-box-layout-ct
<br><br>
There's even and !important to overrite element styels that get generated in the HTML by EXTJS
</aside>
<a href="batch_picker.scss" target="_blank">BatchPicker.scss</a>
</section>
<!-- <section>
<h3><span class="emph">Downed</span> that boss</h3>
<img class="downed-batch-picker-boss" src="images/rhino_knock_off.gif">
</section>
<section>
<h3>The <span class="emph">Reality</span></h3>
<p>Nested 5 times</p>
<pre><code class="sass scss">
.x-btn-icon.sca-calendar-img.batch-picker-icon {
background: image-url('infinity_search_hover.svg') center no-repeat;
}
</code></pre>
<p>Specifers that follow the generated DOM:</p>
<pre><code class="sass scss">
&.x-toolbar.x-box-item.x-toolbar-item.x-toolbar-default.x-box-layout-ct
</code></pre>
<p>There are even "<span class="emph">!important</span>"s to overwrite element styles that get generated in the html by ExtJS</p>
</section> -->
</section>
<section>
<section>
<aside class="notes">PATTY</aside>
<h3>We often <span class="emph">Reuse</span> components</h3>
<p>But they can be styled completely differently</p>
</section>
<section class="animate-buttons" >
<aside class="notes">PATTY</aside>
<p>We leverage top level classes to reskin the same component depending on its usage within the app.</p>
<span class="button-container button-one"><div class="button-label">.sca-drive-panel { }</div><img class="button-ex" src="images/button_ex1.png"></span>
<span class="button-container button-four"><div class="button-label">.sca-batch-picker { }</div><img class="button-ex" src="images/button_ex4.png"></span>
<span class="button-container button-five"><div class="button-label">.sca-status-details { }</div><img class="button-ex" src="images/button_ex5.png"></span>
<span class="button-container button-six"><div class="button-label">.sca-seat-picker { }</div><img class="button-ex" src="images/button_ex6.png"></span>
<span class="button-container button-seven"><div class="button-label">.sca-settings-panel { }</div><img class="button-ex" src="images/button_ex7.png"></span>
</section>
</section>
<section>
<section>
<aside class="notes"> ASHLEY</aside>
<h3>Implementation</h3>
1000s of lines of CSS means there's only <span class="emph">two</span> ways to do this
</section>
<section>
<aside class="notes"> ASHLEY</aside>
<h3>A Grind</h3>
<p>Torturous, never-ending level grind</p>
<img src="images/never_ending_8_bit.gif">
</section>
<section>
<h3>A quest chain</h3>
<aside class="notes">