Slide 1

Slide 1 text

Style-Guide Driven UI Design with Sass Jina Bolton // Product Designer // Do CSS Dev Conf // 2012

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

A fractured process makes for a fractured user experience.” ” —Nate Fortin

Slide 4

Slide 4 text

Create pages

Slide 5

Slide 5 text

Create pages

Slide 6

Slide 6 text

Create systems

Slide 7

Slide 7 text

It used to be that designers made an object and walked away. Today the emphasis must shift to designing the entire life cycle.” ” —Paul Saffo

Slide 8

Slide 8 text

Writing an Interface Style Guide | A List Apart Articles

Slide 9

Slide 9 text

Style Guide Elements

Slide 10

Slide 10 text

Brand Guidelines Logos Tone & Voice Copywriting Standards Typography Color Palettes

Slide 11

Slide 11 text

Layout Grids Spacing Image & Media Sizes

Slide 12

Slide 12 text

Development Standards HTML, CSS, & JS Naming Conventions Directory Structures Validation & QA Version Control

Slide 13

Slide 13 text

Design | Android Developers

Slide 14

Slide 14 text

Style | Design | Android Developers

Slide 15

Slide 15 text

Patterns | Design | Android Developers

Slide 16

Slide 16 text

Building Blocks | Design | Android Developers

Slide 17

Slide 17 text

Building Blocks | Design | Android Developers

Slide 18

Slide 18 text

Do Android Design Comp Library on Project Wiki on GitHub

Slide 19

Slide 19 text

Style Guide | Starbucks

Slide 20

Slide 20 text

Promo Layout A | Style Guide | Starbucks

Slide 21

Slide 21 text

Toggled Backgrounds | Style Guide | Starbucks

Slide 22

Slide 22 text

Toggled Baseline | Style Guide | Starbucks

Slide 23

Slide 23 text

Toggled Boxes | Style Guide | Starbucks

Slide 24

Slide 24 text

Toggled Grid | Style Guide | Starbucks

Slide 25

Slide 25 text

All of the Toggles! | Style Guide | Starbucks

Slide 26

Slide 26 text

Style Tiles

Slide 27

Slide 27 text

Style Tile for The Washington Examiner Site 2012 Campaign Site

Slide 28

Slide 28 text

CSS Preprocessors + Style Guides = Super Rad

Slide 29

Slide 29 text

Keep documentation current & useful

Slide 30

Slide 30 text

Easier maintainability

Slide 31

Slide 31 text

DRY Development

Slide 32

Slide 32 text

Patterns & Proportions

Slide 33

Slide 33 text

Stylus

Slide 34

Slide 34 text

sass-lang.com

Slide 35

Slide 35 text

compass-style.org

Slide 36

Slide 36 text

Sass Benefits

Slide 37

Slide 37 text

Nesting

Slide 38

Slide 38 text

ul.items a { ... } ul.items:hover { ... } .ie-6 ul.items a { ... } Output: SCSS: ul.items a { ... &:hover { ... } .ie-6 & { ... } }

Slide 39

Slide 39 text

ul.items { ... } @media print { ul.items { ... } } Output: SCSS: ul.items a { ... @media print { ... } }

Slide 40

Slide 40 text

.sidebar { border: 1px solid #eee; border-top-color: #fff; border-left: 0; } Output: SCSS: .sidebar { border: 1px solid #eee { top-color: #fff; left: 0; } }

Slide 41

Slide 41 text

Variables

Slide 42

Slide 42 text

body { color: #444; } footer { background: #444; } Output: SCSS: $text: #444; $bg: $text; body { color: $text; } footer { background: $bg; }

Slide 43

Slide 43 text

Mixins & Extend

Slide 44

Slide 44 text

.module { padding: 1em; } .info { padding: 2em } Output: SCSS: @mixin spacing($s: 1em) { padding: $s; } .module { @include spacing; } .info { @include spacing(2em); }

Slide 45

Slide 45 text

.message, .error { ... } .message.alert, .error.alert { ... } .error { ... } Output: SCSS: .message { ... &.alert { ... } } .error { ... @extend .message; }

Slide 46

Slide 46 text

Placeholder Selectors

Slide 47

Slide 47 text

.module, .sidebar { color: #444; } .sidebar, .main { width: 240px; } Output: SCSS: .module { color: #444; } %grid-1 { width: 240px; } .sidebar { @extend .module; @extend %grid-1; } .main { @extend %grid-1; }

Slide 48

Slide 48 text

Color Functions

Slide 49

Slide 49 text

$text: #444 color: lighten($text, 5%); color: darken($text, 5%); color: saturate($text, 5%); color: adjust-hue($text, 180); color: grayscale($text); color: mix($text, #fff);

Slide 50

Slide 50 text

sassme.arc90.com/

Slide 51

Slide 51 text

Commenting Options

Slide 52

Slide 52 text

/* Multiline comment; appears in output */ Output: SCSS: /* Multiline comment; appears in output */ // Singleline comment; // Hidden from output

Slide 53

Slide 53 text

Operations

Slide 54

Slide 54 text

body { font-size: 24px; } Output: SCSS: $size: 12px; body { font-size: $size * 2; }

Slide 55

Slide 55 text

Functions

Slide 56

Slide 56 text

.i-red { background: url(red.png); } .i-blue { background: url(blue.png); } Output: SCSS: @each $c in red, blue { .i-#{$c} { background: url(#{$c}.png); } }

Slide 57

Slide 57 text

.i-red { color: red; } .i-blue { color: blue; } Output: SCSS: @mixin i($color) { @if $color == red { color: red; } @else { color: blue; } } .i-red { @include i(red); } .i-blue { @include i; }

Slide 58

Slide 58 text

Error Reporting

Slide 59

Slide 59 text

First Variables. Then Mixins. Then @extend. Then more advanced stuff! Start with baby steps

Slide 60

Slide 60 text

Stay organized

Slide 61

Slide 61 text

Clarity is beautiful.

Slide 62

Slide 62 text

Clarity > Brevity

Slide 63

Slide 63 text

If you’re nesting more than 3 levels deep, you’re probably doing something wrong.

Slide 64

Slide 64 text

File Organization images/ content/ layout/ javascripts/ vendor/ stylesheets/ vendor/

Slide 65

Slide 65 text

Front-end Maintainability with Sass and Style Guides | Engine Yard Blog

Slide 66

Slide 66 text

Engine Yard App Cloud, Early 2011

Slide 67

Slide 67 text

Engine Yard App Cloud, Early 2011

Slide 68

Slide 68 text

jacobrask.github.com/styledocco/

Slide 69

Slide 69 text

jacobrask.github.com/styledocco/styledocco/examples/bootstrap/docs/buttons.html

Slide 70

Slide 70 text

My Typical Sass Organization

Slide 71

Slide 71 text

// ---------------------------------- // 01. VENDOR FRAMEWORKS @import "compass"; @import "susy";

Slide 72

Slide 72 text

// ------------------------------------ // 02. RESET * { @include box-sizing(border-box); } @import "vendor/normalize";

Slide 73

Slide 73 text

// --------------------------------------------------------- // 03. DEPENDENCIES // Variables/mixins/placeholders/etc // These don’t emit CSS on their own // until they are used. @import "dependencies/measurements"; @import "dependencies/typography"; @import "dependencies/color"; @import "dependencies/images"; @import "dependencies/themes";

Slide 74

Slide 74 text

// --------------------------------------------------------- // 04. FOUNDATION // Plain semantic HTML // No classes/IDs are introduced yet. @import "foundation/page"; @import "foundation/links"; @import "foundation/headings"; @import "foundation/text"; @import "foundation/lists"; @import "foundation/forms";

Slide 75

Slide 75 text

// ---------------------------------- // 05. COMPONENTS // Reusable modules, components, etc. @import "components/buttons"; @import "components/messaging"; @import "components/dropdowns";

Slide 76

Slide 76 text

// ---------------------------------- // 06. LAYOUT @import "layout/grid"; @import "layout/banner"; @import "layout/navigation"; @import "layout/complementary"; @import "layout/contentinfo";

Slide 77

Slide 77 text

// ---------------------------------- // 07. TOOLS @import "tools/helpers"; @import "tools/print";

Slide 78

Slide 78 text

Do

Slide 79

Slide 79 text

Caption and/or URL

Slide 80

Slide 80 text

http://codepen.io/jina/pen/iosjp

Slide 81

Slide 81 text

do.com’s Rainbow Color Stripe

Slide 82

Slide 82 text

Do Style Guide

Slide 83

Slide 83 text

Do Style Guide

Slide 84

Slide 84 text

Do Style Guide

Slide 85

Slide 85 text

What else?

Slide 86

Slide 86 text

compass.handlino.com

Slide 87

Slide 87 text

mhs.github.com/scout-app

Slide 88

Slide 88 text

livereload.com

Slide 89

Slide 89 text

codekit.com

Slide 90

Slide 90 text

susy.oddbird.net

Slide 91

Slide 91 text

stuffandnonsense.co.uk/projects/320andup

Slide 92

Slide 92 text

smacss.com

Slide 93

Slide 93 text

blesscss.com

Slide 94

Slide 94 text

Just give it a try!

Slide 95

Slide 95 text

sass-lang.com

Slide 96

Slide 96 text

Team Sass Design FTW!

Slide 97

Slide 97 text

Sass Logo Inspiration

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

Sass Brand Guidelines

Slide 101

Slide 101 text

Sass Style Tile

Slide 102

Slide 102 text

Current Design Progress. Stay tuned!

Slide 103

Slide 103 text

@TeamSassDesign

Slide 104

Slide 104 text

#teamSass

Slide 105

Slide 105 text

Be regular and orderly in your life so that you may be violent and original in your work.” ” —Gustave Flaubert

Slide 106

Slide 106 text

sushiandrobots.com

Slide 107

Slide 107 text

artinmycoffee.com

Slide 108

Slide 108 text

speakerdeck.com/u/jina

Slide 109

Slide 109 text

@jina Thank You!