-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
566 lines (537 loc) · 20.1 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Modular design with CSS</title>
<meta name="description" content="A presentation about writing modular and maintainable CSS">
<meta name="author" content="Gregory Van Looy">
<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 rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/beige.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<link href='http://fonts.googleapis.com/css?family=Poller+One' rel="stylesheet" type="text/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>
<style>
.reveal h1,
.reveal h2,
.reveal h3 {
/*font-family: 'Arial Bold', Arial, sans-serif;*/
font-family: 'Poller One', cursive;
/*text-transform: uppercase;*/
}
.reveal h1 {
text-transform: uppercase;
}
</style>
<!--[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">
<section data-background="img/in-out.jpg">
<h1 style="color: #fff; text-shadow: 0 0 10px rgba(0,0,0,0.75);">Modular design<br>with CSS</h1>
<p style="color: #fff;">
<small>Gregory Van Looy / Fronteers meetup — 22/05/2014</small>
</p>
</section>
<section>
<h2><a href="http://twitter.com/bengie">@bengie</a></h2>
<p>Freelance HTML & CSS architect/consultant @ <a href="http://diezjietal.be">diezjietal</a></p>
<p class="fragment">I suck @ JavaScript</p>
<aside class="notes">
waarom geen front-end dev
</aside>
</section>
<section>
<h2>Once upon a time …</h2>
<aside class="notes">
tableless design was gestart, web 2.0, in de plaats kregen we DIV -itis
</aside>
</section>
<section>
<pre><code class="xml" data-trim>
<div class="fields">
<div class="field-a" id="field-a-id-here">
<div class="field-b" id="field-b-id-here">
<div class="field-c" id="field-c-id-here">
<div class="field-d" id="field-d-id-here">
<div class="field-e" id="field-e-id-here">
<div class="field-f" id="field-f-id-here">
Lorem ipsum dolor sit amet.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</code></pre>
<p><small>* Any resemblance to a real CMS is purely coincidental.</small></p>
</section>
<section>
<pre><code class="css" data-trim>
header nav#main-nav > ul.nav li ul li {}
</code></pre>
<aside class="notes">
OK t doet zijn werk maar voor structuur, maintenance en performance .... een dikke 2/10
</aside>
</section>
<section>
<h2>Meanwhile ...</h2>
<ul>
<li>Programming languages got OOP and MV* frameworks</li>
<li>JS started adopting those principles. JS Frameworks started to emerge.</li>
<li>... in CSS world … <span class="fragment">NOTHING</span></li>
</ul>
</section>
<section>
<h3>Disclaimer</h3>
<p>CSS wasn't totally neglected.</p>
<p>People started <a href="http://www.simplebits.com/publications/bulletproof/">bulletproofing</a>, <a href="http://handcraftedcss.com/">handcrafting</a> and <a href="http://hardboiledwebdesign.com/">hardboiling</a> CSS.</p>
<aside class="notes">
ging meer over goede CSS schrijven, tableless design en creatieve oplossingen, alsook CSS3
</aside>
</section>
<section>
<h2>Present day</h2>
</section>
<section>
<h2>Modular and scalable CSS</h2>
</section>
<section>
<h2>Why?</h2>
<p>Every site gets bigger.</p>
<aside class="notes">
Geef toe: elke site groeit. En heb t niet over het aantal pagina's maar over de features
</aside>
</section>
<section>
<h2>Normalizing</h2>
<aside class="notes">
Stap 1 bij ontvangst v d designs die je moet slicen
</aside>
</section>
<section style="text-align: left;">
<p>
<small>
To: Gregory Van Looy <br>
From: [email protected] <br>
Subject: Designs
</small>
</p>
<p>
Hi Greg, <br>
I've attached the design to this email.
</p>
<p>Good luck, <br>
some designer
</p>
<p><code>attachment: home-final-v2-update.jpg</code></p>
<aside class="notes">
hoe begin je daar aan. Veel heen en weer mails als gevolg
</aside>
</section>
<section style="text-align: left;">
<p>
<small>
To: Gregory Van Looy <br>
From: [email protected] <br>
Subject: Styleguide
</small>
</p>
<p>
Hi Greg, <br>
This is the styleguide:
</p>
<ul>
<li>Body: 'Comic Sans' 12px #000</li>
<li>Link color: #090</li>
<li>h1: 54px</li>
<li>…</li>
</ul>
<p>Have fun, <br>
some designer
</p>
<p><code>attachment: design-styleguide.psd</code></p>
<aside class="notes">
niet gedetailleerd genoeg, ga maar op ontdekking
</aside>
</section>
<section style="text-align: left;">
<p><small>
To: Gregory Van Looy <br>
From: [email protected] <br>
Subject: Styleguide
</small>
</p>
<p>
Hi Greg, <br>
This is the styleguide:
</p>
<p>Have fun, <br>
a crazy designer
</p>
<p>
<code>attachment: Book-A-general-components.pdf</code>
<code>attachment: Book-B-mobile-styleguide.pdf</code>
<code>attachment: Book-C-desktop-styleguide.pdf</code>
</p>
<aside class="notes">
trop is teveel - als ge 150 paginas nodig hebt om uw design uit te leggen dan ben je verkeerd bezig
</aside>
</section>
<section>
<pre><code class="css" data-trim>
ul {
margin-bottom: 24px;
}
p {
margin: 18px 0;
}
h2 {
margin-bottom: 20px;
}
</code></pre>
</section>
<section>
<pre><code class="css" data-trim>
ul, h2 {
margin-bottom: 20px;
}
p {
margin: 20px 0;
}
</code></pre>
</section>
<section>
<pre><code class="css" data-trim>
/* Sass */
$base-spacing-unit: 20px;
ul, h2 {
margin-bottom: $base-spacing-unit;
}
p {
margin: $base-spacing-unit 0;
}
</code></pre>
</section>
<section>
<pre><code class="css" data-trim>
p {
font-size: 16px;
}
figcaption {
font-size: 15px;
}
h6 {
font-size: 17px;
}
</code></pre>
</section>
<section>
<pre><code class="css" data-trim>
p,
figcaption,
h6 {
font-size: 16px;
}
/* Sass */
$base-font-size: 16px;
p,
figcaption,
h6 {
font-size: $base-font-size;
}
</code></pre>
</section>
<section>
<h2>80:20</h2>
<p><small>© Harry Roberts</small></p>
<aside class="notes">
t is niet omdat het kan, dat je het ook moet doen
</aside>
</section>
<section>
<h2>Modularizing</h2>
</section>
<section>
<pre><code data-trim class="css">
.article-teaser {}
.carousel {}
.tabs {}
</code></pre>
</section>
<section>
<h3>Dig deeper</h3>
<aside class="notes">
We kunnen nog dieper gaan
</aside>
</section>
<section>
<pre><code data-trim class="css">
.tag {}
.more-link {}
.icon {}
</code></pre>
</section>
<section data-background="img/bootstrap.png">
<aside class="notes">
Inspiratie: Bootstrap
</aside>
</section>
<section>
<h2>How?</h2>
</section>
<section>
<h2><a href="http://smacss.com">SMACSS</a></h2>
<p>Scalable and Modular Architecture for CSS</p>
</section>
<section>
<h3>Categorizing CSS rules</h3>
<ol>
<li>Base</li>
<li>Layout</li>
<li>Module</li>
<li>State</li>
<li>Theme</li>
</ol>
</section>
<section>
<h3>1. Base rules</h3>
<pre><code data-trim class="css">
/* no classes here, only element selectors */
body {}
p {}
a {}
</code></pre>
</section>
<section>
<h3>2. Layout rules</h3>
<pre><code data-trim class="css">
/* grid */
.col {}
.col--2 {}
.col--primary {}
/* layout specific: .layout-- prefix */
.layout--homepage {}
</code></pre>
<p><code>.layout--XXXX</code> classes are added to the <code>html</code> tag</p>
</section>
<section>
<h3>3. Module rules</h3>
<p>Biggest chunk of your CSS file</p>
<pre><code data-trim class="css">
/* skip the prefix, it's too verbose */
.module-carousel {}
/* that's the way, uhu uhu */
.carousel {}
</code></pre>
</section>
<section>
<h3>4. State rules</h3>
<pre><code data-trim class="css">
/* .is- prefix */
.is-active {}
.is-hidden {}
.is-collapsed {}
.is-expanded {}
</code></pre>
</section>
<section>
<h3>4b. State rules</h3>
<p>JavaScript: easier to debug</p>
<pre><code data-trim class="css">
/* .js-is- prefix */
.js-is-active {}
.js-is-hidden {}
.js-is-collapsed {}
.js-is-expanded {}
</code></pre>
</section>
<section>
<h3>5. Theme rules</h3>
<p>Will you need this one?</p>
<h3 class="fragment">YES!!!!</h3>
<div class="fragment">
<pre><code data-trim class="css">
.theme--culture .article {}
.theme--x-mas blockquote:before {
content: 'hohoho';
}
</code></pre>
<p><code>.theme--</code> classes are added to the <code>html</code> tag</p>
</div>
</section>
<section>
<h3>Folder structure</h3>
<p><small>in combination with <a href="http://sass-lang.com">Sass</a></small></p>
<pre><code class="bash">
| - sass
|- base
_base.scss
_normalize.scss
_defaults.scss
_webfonts.scss
...
|- layout
_layout.scss
_grid.scss
_sections.scss
...
|- modules
_modules.scss
_carousel.scss
_pagination.scss
...
|- state
_state.scss
...
|- theme
_theme.scss
_x-mas.scss
...
_site-settings.scss
_mixins.scss
main.scss
</code></pre>
</section>
<section data-background="img/made-in.jpg">
<h1 style="color: #fff;">Level up</h1>
</section>
<section>
<h2>BEM</h2>
<p>Block - Element - Modifier</p>
</section>
<section>
<pre><code data-trim class="css">
.block {}
.block__element {} /* note: double underscore */
.block--modifier {} /* note: double hyphen */
</code></pre>
<p><small>More on BEM: <a href="http://bem.info/">here</a>, <a href="http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/">here</a>, <a href="http://nicolasgallagher.com/about-html-semantics-front-end-architecture/">here</a> and <a href="http://coding.smashingmagazine.com/2012/04/16/a-new-front-end-methodology-bem/">here</a></small></p>
</section>
<section>
<h3>Old skool</h3>
<pre><code class="css" data-trim>
header nav#main-nav > ul.nav li ul li {}
</code></pre>
</section>
<section>
<h3>Example</h3>
<pre><code data-trim class="xml">
<article class="article">
<header class="article__header">...</header>
<div class="article__body">...</div>
<footer class="article__footer">...</footer>
</article>
</code></pre>
</section>
<section>
<h3>... with modifier</h3>
<pre><code data-trim class="xml">
<!-- note: class chaining -->
<article class="article article--primary">
<header class="article__header">...</header>
<div class="article__body">...</div>
<footer class="article__footer">...</footer>
</article>
</code></pre>
</section>
<section>
<h3>Naming conventions</h3>
<pre><code data-trim class="css">
/* Bad */
.pageHeader {}
.button--blue {}
/* Good */
.page-header {}
.button--primary {}
</code></pre>
</section>
<section>
<pre><code class="css" data-trim>
/* This is OK! */
.article__header--no-border {}
.teaser--large--primary {}
</code></pre>
</section>
<section>
<img src="img/ugly-code.jpg" alt="">
<aside class="notes">
menig verdeelt, t is lelijk maar t doet wel zijn werk. makkelijk herkenbaar, makkelijk te debuggen, makkelijk uit te breiden
</aside>
</section>
<section>
<h3>Advantages</h3>
<ul>
<li>It's clear what each selector's purpose is</li>
<li>Less chance of colliding with CSS of third party plugins</li>
<li>Lesser nesting of selectors (especially when used with SMACSS theming)
<pre><code data-trim class="css">
/* old skool */
article > header {}
/* old skool + Smacss theming */
.theme--x-mas article > header {}
/* BEM */
.article__header {}
/* BEM + SMACSS theming */
.theme--x-mas .article__header {}
</code></pre>
</li>
<li class="fragment">… thus, your CSS rendering is faster</li>
</ul>
<aside class="notes">
en snellere css is voor iedereen een WIN
</aside>
</section>
<section data-background="img/steampunk-pc.png">
<h1 style="color: #fff;">THE END</h1>
<h3 style="color: #fff;">Questions?</h3>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.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,
controls: false,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/fade/none
backgroundTransition: 'slide',
// 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>