Slide 1

Slide 1 text

Sass at GitHub !

Slide 2

Slide 2 text

- Probably a few people at GitHub sometime in 2012 “We should check out Sass.”

Slide 3

Slide 3 text

Today:

Slide 4

Slide 4 text

75 people have made a commit in /stylesheets on github/github

Slide 5

Slide 5 text

…but only 14 are “experts”

Slide 6

Slide 6 text

Over 6,000 different selectors

Slide 7

Slide 7 text

Over 6,000 different selectors (thanks, Internet Explorer)

Slide 8

Slide 8 text

133 .scss files

Slide 9

Slide 9 text

We’ve made mistakes along the way

Slide 10

Slide 10 text

I’m Ben Bleikamp

Slide 11

Slide 11 text

@bleikamp

Slide 12

Slide 12 text

@bleikamp !

Slide 13

Slide 13 text

The stack

Slide 14

Slide 14 text

Rails “2.3”

Slide 15

Slide 15 text

Rails “2.3” HTML ERB + View Models

Slide 16

Slide 16 text

Rails “2.3” HTML ERB + View Models CoffeeScript

Slide 17

Slide 17 text

Rails “2.3” HTML ERB + View Models CoffeeScript Sass (SCSS)

Slide 18

Slide 18 text

Avoiding mistakes

Slide 19

Slide 19 text

75 people touched a stylesheet

Slide 20

Slide 20 text

So we wrote a CSS testing framework

Slide 21

Slide 21 text

JK

Slide 22

Slide 22 text

We use tools available to everyone

Slide 23

Slide 23 text

Mistakes happen

Slide 24

Slide 24 text

Mistakes happen, limit them

Slide 25

Slide 25 text

Make problems visible

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Team mentions

Slide 29

Slide 29 text

Stop writing new CSS

Slide 30

Slide 30 text

The Styleguide

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

KSS github.com/kneath/kss A methodology for documenting CSS and generating styleguides.

Slide 33

Slide 33 text

// A bubble is the basic container for a section of // content in a mobile layout. The content in a bubble // should be related and pages usually have multiple // bubbles. // // .no-padding - Remove padding from a bubble // // Styleguide 1.1

Slide 34

Slide 34 text

// A bubble is the basic container for a section of // content in a mobile layout. The content in a bubble // should be related and pages usually have multiple // bubbles. // // .no-padding - Remove padding from a bubble // // Styleguide 1.1 Explanation

Slide 35

Slide 35 text

// A bubble is the basic container for a section of // content in a mobile layout. The content in a bubble // should be related and pages usually have multiple // bubbles. // // .no-padding - Remove padding from a bubble // // Styleguide 1.1 Explanation Modifiers

Slide 36

Slide 36 text

// A bubble is the basic container for a section of // content in a mobile layout. The content in a bubble // should be related and pages usually have multiple // bubbles. // // .no-padding - Remove padding from a bubble // // Styleguide 1.1 Explanation Modifiers Reference

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

We’re picky about code, too

Slide 39

Slide 39 text

We tell people what we expect in in their commits

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

We hate ⌘C, ⌘V

Slide 42

Slide 42 text

GitHub and Gist look very similar

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

⌘C, ⌘V

Slide 45

Slide 45 text

Build something new on GitHub

Slide 46

Slide 46 text

Build something new on GitHub Document it

Slide 47

Slide 47 text

Build something new on GitHub Document it Primer & Styleguide

Slide 48

Slide 48 text

Primer?

Slide 49

Slide 49 text

Primer is shared styles

Slide 50

Slide 50 text

Components

Slide 51

Slide 51 text

Mix-ins & variables

Slide 52

Slide 52 text

“Speed is the second biggest engagement driver on the Internet. Just after perceived speed.” — @maccaw

Slide 53

Slide 53 text

Jon Rohan CSS Performance Savant @jonrohan

Slide 54

Slide 54 text

Diff pages

Slide 55

Slide 55 text

Average diff = 9,000 lines of HTML across all files

Slide 56

Slide 56 text

That’s a lot of opportunities for bad markup

Slide 57

Slide 57 text

…and redrawing

Slide 58

Slide 58 text

Hiding & showing with display: none; or visibility: hidden;

Slide 59

Slide 59 text

CSS animations

Slide 60

Slide 60 text

User actions

Slide 61

Slide 61 text

The fewer DOM matches there are, the faster the site loads

Slide 62

Slide 62 text

Some CSS… snafoos?

Slide 63

Slide 63 text

Overqualifying selectors ul#nav

Slide 64

Slide 64 text

Overqualifying selectors #nav

Slide 65

Slide 65 text

Chaining selectors .octicon.mini.private

Slide 66

Slide 66 text

Chaining selectors .octicon-private

Slide 67

Slide 67 text

Attribute selectors [class^=“octicon-”]

Slide 68

Slide 68 text

Catching these pesky CSS performance problems

Slide 69

Slide 69 text

Graphite Scalable Realtime Graphing

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

CSS Explain github.com/josh/css-explain SQL EXPLAIN for CSS selectors

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

Timeline Chrome Developer Tools

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Audits Chrome Developer Tools

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

We use the things we build

Slide 80

Slide 80 text

Making things work on a phone

Slide 81

Slide 81 text

It’s responsive fast

Slide 82

Slide 82 text

Re-write HTML and CSS specifically for mobile

Slide 83

Slide 83 text

(Almost) no JavaScript

Slide 84

Slide 84 text

No CSS animations

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

Watching for problems

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

This talk isn’t really advice

Slide 89

Slide 89 text

Keep things simple

Slide 90

Slide 90 text

Write less code

Slide 91

Slide 91 text

Measure everything

Slide 92

Slide 92 text

Thank you. (I’ll tweet a link to these slides from @bleikamp)