Slide 1

Slide 1 text

XXLCSS How to scale CSS and keep your sanity @sugarenia

Slide 2

Slide 2 text

XXLCSS How to scale CSS and keep your sanity @sugarenia

Slide 3

Slide 3 text

I’m Sugar.

Slide 4

Slide 4 text

I’m a designer.

Slide 5

Slide 5 text

I’m happy.

Slide 6

Slide 6 text

Web design is awesome!

Slide 7

Slide 7 text

Web design is awesome! ...sometimes

Slide 8

Slide 8 text

The problem

Slide 9

Slide 9 text

Maintainability

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

OOCSS

Slide 12

Slide 12 text

OOCSS SMACSS

Slide 13

Slide 13 text

OOCSS SMACSS Sass

Slide 14

Slide 14 text

OOCSS SMACSS Sass Bootstrap & Foundation

Slide 15

Slide 15 text

The goals

Slide 16

Slide 16 text

GOAL #1 Don’t start from scratch every time

Slide 17

Slide 17 text

GOAL #2 Markup standards, especially for large teams

Slide 18

Slide 18 text

GOAL #3 Don’t bug your designers about ALL THE THINGS

Slide 19

Slide 19 text

GOALS #4, #5 & #6 Flexibility Speed Performance

Slide 20

Slide 20 text

GOAL #7 Own the code

Slide 21

Slide 21 text

Best practices

Slide 22

Slide 22 text

Avoid classitis

Slide 23

Slide 23 text

Avoid extra markup

Slide 24

Slide 24 text

Non-semantic class names

Slide 25

Slide 25 text

Use descendant selectors

Slide 26

Slide 26 text

No.

Slide 27

Slide 27 text

Better practices

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Developers know better

Slide 30

Slide 30 text

Developers know better

Slide 31

Slide 31 text

Developers know better Abstraction

Slide 32

Slide 32 text

Developers know better Abstraction Object orientation

Slide 33

Slide 33 text

Developers know better Abstraction Object orientation Performance first

Slide 34

Slide 34 text

Developers know better Abstraction Object orientation Performance first DRY

Slide 35

Slide 35 text

Developers know better Abstraction Object orientation Performance first DRY KISS

Slide 36

Slide 36 text

No IDs in CSS please

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

#header #footer

Slide 39

Slide 39 text

#header #footer #footer { background-color: #000; }

Slide 40

Slide 40 text

#header #footer #footer { background-color: #000; } #footer a { color: #fff; }

Slide 41

Slide 41 text

#header #footer .twitter #footer { background-color: #000; } #footer a { color: #fff; }

Slide 42

Slide 42 text

#header #footer .twitter #footer { background-color: #000; } #footer a { color: #fff; } .twitter { background-color: #fff; }

Slide 43

Slide 43 text

#header #footer .twitter #footer { background-color: #000; } #footer a { color: #fff; } .twitter { background-color: #fff; } .twitter a { color: #000; }

Slide 44

Slide 44 text

#header #footer .twitter #footer { background-color: #000; } #footer a { color: #fff; } .twitter { background-color: #fff; } .twitter a { color: #000; }

Slide 45

Slide 45 text

Semantic?

Slide 46

Slide 46 text

Semantic? Pragmatic.

Slide 47

Slide 47 text

Big heading

Slide 48

Slide 48 text

Big heading

h1 { font-size: 3em; } h2 { font-size: 2.4em; } h3 { font-size: 2em; } h4 { font-size: 1.6em; }

Slide 49

Slide 49 text

Big heading

h1 { font-size: 3em; } h2, .footer h4 { font-size: 2.4em; } h3 { font-size: 2em; } h4 { font-size: 1.6em; }

Slide 50

Slide 50 text

Big heading

h1, .alpha { font-size: 3em; } h2, .beta { font-size: 2.4em; } h3, .gamma { font-size: 2em; } h4, .delta { font-size: 1.6em; }

Slide 51

Slide 51 text

Style classes are totally OK, dude

Slide 52

Slide 52 text

Classes work much better when we use them to represent visual semantics, rather than keeping them tied to content. — Nicole Sullivan (@stubbornella)

Slide 53

Slide 53 text

...

Slide 54

Slide 54 text

...

Slide 55

Slide 55 text

Descendant selectors can bite you

Slide 56

Slide 56 text

This is the box header

Slide 57

Slide 57 text

This is the box header

.box { background-color: #fff; border: 1px solid #ccc; } .box h3 { text-transform: uppercase; color: #333; }

Slide 58

Slide 58 text

This is the box header

Slide 59

Slide 59 text

This is the box header

.box { background-color: #fff; border: 1px solid #ccc; } .box h3, .box h4 { text-transform: uppercase; color: #333; }

Slide 60

Slide 60 text

This is the box header

.box { background-color: #fff; border: 1px solid #ccc; } .box-header { text-transform: uppercase; color: #333; }

Slide 61

Slide 61 text

Modularize

Slide 62

Slide 62 text

Stop overdesigning

Slide 63

Slide 63 text

Stop thinking in pages

Slide 64

Slide 64 text

Everything is a module

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a posuere velit.

Slide 67

Slide 67 text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a posuere velit.

Slide 68

Slide 68 text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a posuere velit.

Slide 69

Slide 69 text

me
@Stubbornella 14 minutes ago

Slide 70

Slide 70 text

.media, .bd { overflow:hidden; } .media .img { float:left; margin-right: 10px; } .media .img img { display:block; } .media .imgExt { float:right; margin-left: 10px; }

Slide 71

Slide 71 text

Do one thing and one thing only

Slide 72

Slide 72 text

Combine modules for fun and profit

Slide 73

Slide 73 text

Modules should be oblivious of their context

Slide 74

Slide 74 text

Toolbox

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Preprocessors

Slide 77

Slide 77 text

Preprocessors Sass, that is.

Slide 78

Slide 78 text

CSS Frameworks

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

...or UI Toolkits?

Slide 81

Slide 81 text

The time saved using a css framework is spent looking up how to work with that framework. — Jesse Shawl (@jshawl)

Slide 82

Slide 82 text

Updating is hell

Slide 83

Slide 83 text

MY ADVICE Roll your own framework

Slide 84

Slide 84 text

Living style guides

Slide 85

Slide 85 text

http://style.codeforamerica.org

Slide 86

Slide 86 text

http://patterns.alistapart.com

Slide 87

Slide 87 text

Better collaboration

Slide 88

Slide 88 text

Avoid code duplication

Slide 89

Slide 89 text

Easy device testing

Slide 90

Slide 90 text

http://vinspee.me/style-guide-guide/

Slide 91

Slide 91 text

Do try this at home.

Slide 92

Slide 92 text

Thanks! You rock. @sugarenia