Slide 1

Slide 1 text

MODULE DESIGN & UI DEV PATTERNS code from the inside out

Slide 2

Slide 2 text

OR ...

Slide 3

Slide 3 text

THE FAILURE OF THE COMP pictures are for photoshop

Slide 4

Slide 4 text

DESIGNERS & STAKEHOLDERS we’ve all had this conversation

Slide 5

Slide 5 text

We need a comp!

Slide 6

Slide 6 text

DESIGNERS SEE colors, type, icons, images, spacing, borders, gradients, etc ...

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

DEVELOPERS SEE ahhh ...

Slide 10

Slide 10 text

Where do I begin?

Slide 11

Slide 11 text

Can’t you just export HTML?

Slide 12

Slide 12 text

That Never Works!

Slide 13

Slide 13 text

OHHH, YOU NEED SPECS? sure, I have a red-line for that

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

UI DEVELOPERS ... our context is all wrong

Slide 17

Slide 17 text

Start from the upper left, right?
that works.

Slide 18

Slide 18 text

Start from the upper left, right?
that works. Styles are written based on placement in the view CSS too specific. Very fragile with placement Presentation classes in the markup Poor code reuse, if any at all. To much ‘copy pasta’ A major case of the div’itus Using IDs for styling to over-ride the cascade

Slide 19

Slide 19 text

BETWEEN DESIGNERS & DEVS THE COMP IS THE ONLY CONSTANT what could possibly go wrong?

Slide 20

Slide 20 text

PICTURE WORTH 1000 WORDS a comp is worth 10,000 development variations

Slide 21

Slide 21 text

ONE OF THESE THINGS ... are not like the other!

Slide 22

Slide 22 text

!
! !
Free image of the week
! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! portrait of a young woman smiling ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! !
! ! !
Come back each week and stay inspired.
! ! !

Stockbyte

! ! !

portrait of a young woman smiling

! ! ! View image ! ! ! Get free image ! !
!
widget #1 by developer A

Slide 23

Slide 23 text

!
! !
Free image of the week
! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! portrait of a young woman smiling ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! !
! ! !
Come back each week and stay inspired.
! ! !

Stockbyte

! ! !

portrait of a young woman smiling

! ! ! View image ! ! ! Get free image ! !
!
widget #1 by developer A

Slide 24

Slide 24 text

!
! !
Free image of the week
! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! portrait of a young woman smiling ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! !
! ! !
Come back each week and stay inspired.
! ! !

Stockbyte

! ! !

portrait of a young woman smiling

! ! ! View image ! ! ! Get free image ! !
!
widget #1 by developer A Cause I need two classes and an ID to make a header!

Slide 25

Slide 25 text

!
! !
Free image of the week
! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! portrait of a young woman smiling ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! !
! ! !
Come back each week and stay inspired.
! ! !

Stockbyte

! ! !

portrait of a young woman smiling

! ! ! View image ! ! ! Get free image ! !
!
widget #1 by developer A Cause I need two classes and an ID to make a header! HTML tags ... no one uses those.

Slide 26

Slide 26 text

!
! !
Free image of the week
! !
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! portrait of a young woman smiling ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
! !
! ! !
Come back each week and stay inspired.
! ! !

Stockbyte

! ! !

portrait of a young woman smiling

! ! ! View image ! ! ! Get free image ! !
!
widget #1 by developer A Cause I need two classes and an ID to make a header! HTML tags ... no one uses those. Is that a table? Oh no you didn’t!

Slide 27

Slide 27 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B

Slide 28

Slide 28 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Ahhh ... this is the same

Slide 29

Slide 29 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Ahhh ... this is the same This is NOT!

Slide 30

Slide 30 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B

Slide 31

Slide 31 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B IDs in two separate stylesheets, that’s better?

Slide 32

Slide 32 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Let’s define a color at the tag, that’s good.

Slide 33

Slide 33 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Let’s define a color at the tag, that’s good. But wait ... we are overriding by changing a whole widget block?

Slide 34

Slide 34 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Let’s define a color at the tag, that’s good. But wait ... we are overriding by changing a whole widget block? Yup ... let’s reapply that color again. USE THE POWER OF THE ID!

Slide 35

Slide 35 text

!
! !
! ! ! Special offer ! !
! !
! ! !
! ! ! !
! ! ! ! ! 10% off ! ! ! !
! ! !
! ! !
! ! ! !

! ! ! ! ! Purchase a new 1-Month Subscription by June 30, 2011 and save 10%. Use promo code ZP3PC46N during checkout to enjoy your savings today. ! ! ! !

! ! ! ! Get the details ! ! !
! !
!
widget #2 by developer B Let’s define a color at the tag, that’s good. But wait ... we are overriding by changing a whole widget block? Yup ... let’s reapply that color again. USE THE POWER OF THE ID!

Slide 36

Slide 36 text

CAN WE DO IT BETTER?

Slide 37

Slide 37 text

CAN WE DO IT BETTER?

Slide 38

Slide 38 text

THE BEST PART IS ... you already know how to do this

Slide 39

Slide 39 text

TAKE A STEP BACK AND THINK the ‘page’ is a deprecated concept

Slide 40

Slide 40 text

FIGHT THE SMALL BATTLES the element and the module

Slide 41

Slide 41 text

What are elements? Visual elements are the basic building blocks of the UI. Well engineered individual elements reduces duplication and increases consistency.

Slide 42

Slide 42 text

What are elements? Buttons

Slide 43

Slide 43 text

What are elements? Buttons Typography

Slide 44

Slide 44 text

What are elements? Buttons Typography Color pallet

Slide 45

Slide 45 text

What are elements? Buttons Typography Color pallet standard icons

Slide 46

Slide 46 text

What are elements? Buttons Typography Color pallet standard icons borders and line widths

Slide 47

Slide 47 text

What are modules? Using the engineered visual elements, construct modules. Caveat ... modules can also be assembled of other smaller modules and UI patterns (mind blown)

Slide 48

Slide 48 text

What are modules? Header module

Slide 49

Slide 49 text

What are modules? Header module Nav module

Slide 50

Slide 50 text

What are modules? Header module Nav module Hero copy module

Slide 51

Slide 51 text

What are modules? Header module Hero module Nav module Hero copy module

Slide 52

Slide 52 text

What are modules? Header module Hero module Nav module Hero copy module Article module

Slide 53

Slide 53 text

What are modules? Header module Hero module Nav module Hero copy module Article module List module

Slide 54

Slide 54 text

OOSCSS picking up where CSS left off & where OOCSS can never go

Slide 55

Slide 55 text

These are books on Object Oriented Programming. CSS is not on one of them!

Slide 56

Slide 56 text

GREAT CONCEPT bad name • Identify reusable objects • Be semantic w/HTML • Minimize selectors • Extend your classes • ‘Style’ separate from content • ‘Content’ separate from container This is GREAT stuff

Slide 57

Slide 57 text

OBJECT ORIENTATED CSS ... shortcomings • CSS Selectors are not objects • Relies heavily on ‘presentation classes’ • Requires maintenance of DOM elements for design updates • Promotes extending in the DOM, not the CSS • Uses vanilla CSS

Slide 58

Slide 58 text

THE OOCSS PROCESS the classing of the DOM OOCSS, in short, is a process of defining standardized presentational selectors which are in turn applied to the DOM. Extensions of such selectors are then extended in the DOM for added effect. It is likely that you will see examples like what you see here. ! ! Button Generator

Slide 59

Slide 59 text

THE OOCSS PROCESS the classing of the DOM OOCSS, in short, is a process of defining standardized presentational selectors which are in turn applied to the DOM. Extensions of such selectors are then extended in the DOM for added effect. It is likely that you will see examples like what you see here. ! ! Button Generator What’s with using the tag for ‘icon’ now?

Slide 60

Slide 60 text

OOCSS FRAMEWORKS attempts to automate OOCSS CSS frameworks have been using OOCSS methods since inception. Where these fail is the insane amount of CSS selectors that by default are added to the site’s CSS. From grid systems to UI elements, CSS bloat is a real issue. Ironically this bloat is what OOCSS is supposed to address.

Slide 61

Slide 61 text

OOCSS FRAMEWORKS attempts to automate OOCSS CSS frameworks have been using OOCSS methods since inception. Where these fail is the insane amount of CSS selectors that by default are added to the site’s CSS. From grid systems to UI elements, CSS bloat is a real issue. Ironically this bloat is what OOCSS is supposed to address. Twitter’s bootstrap default includes 4914 lines of CSS.

Slide 62

Slide 62 text

OOCSS FRAMEWORKS attempts to automate OOCSS CSS frameworks have been using OOCSS methods since inception. Where these fail is the insane amount of CSS selectors that by default are added to the site’s CSS. From grid systems to UI elements, CSS bloat is a real issue. Ironically this bloat is what OOCSS is supposed to address. Twitter’s bootstrap default includes 4914 lines of CSS.

Slide 63

Slide 63 text

THE CSS DREAM redesign without DOM editing Imagine a world where new design requirements are only addressed by updating CSS? Functional modules and view templates are not edited. I don’t feel OOCSS will get us there, but OOSCSS will.

Slide 64

Slide 64 text

OBJECT ORIENTATED SCSS the future of silent selectors What if we lived in a world where the ‘object’ selectors from OOCSS can be created, but never manifest themselves as CSS until they are used in semantic application? What if we could seamlessly extend selectors in our CSS and not have to touch the DOM? What if ....

Slide 65

Slide 65 text

SASS 3.2 re-writing what we can do with CSS Extending elements in vanilla CSS is hard to track. Between nested selectors and the sheer volume alone make this an arduous task. Sass gives us clarity. The ability to really define objects in our SCSS and apply them to semantic selectors within our CSS. The dream realized. // silent classes %kung { background: green; color: yellow; } %foo { background: orange; color: red; font-size: 12px; } // selectors extending silent classes .foo_one { @extend %foo; } .foo_two { @extend %foo; } // output CSS .foo_one, .foo_two { background: orange; color: red; font-size: 12px; }

Slide 66

Slide 66 text

OOSCSS a real object oriented solution

Slide 67

Slide 67 text

ELEMENTS, MODULES AND PATTERNS OH MY! how do you manage all of this?

Slide 68

Slide 68 text

THE PATTERN LIBRARY living visual document

Slide 69

Slide 69 text

ELEMENTS AND SIMPLE UI PATTERNS text, colors and buttons for example

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

ASSEMBLE THE MODULE a view is an assembly of elements and patterns

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

That looks like a module

Slide 77

Slide 77 text

Cool. Developed the module in an abstract environment.

Slide 78

Slide 78 text

Cool. Developed the module in an abstract environment. Now we can use this anywhere. All UX/UI cleanly encapsulated.

Slide 79

Slide 79 text

Cool. Developed the module in an abstract environment. Now we can use this anywhere. All UX/UI cleanly encapsulated. When developing, no elements were created. Typography and color are all inherited.

Slide 80

Slide 80 text

Cool. Developed the module in an abstract environment. Now we can use this anywhere. All UX/UI cleanly encapsulated. Follow the example HTML and you are rockin! When developing, no elements were created. Typography and color are all inherited.

Slide 81

Slide 81 text

Reference SCSS

Slide 82

Slide 82 text

Reference SCSS Use examples

Slide 83

Slide 83 text

LET’S TAKE A LOOK AT ANOTHER maybe a feature block?

Slide 84

Slide 84 text

Oh yeah, looks like another great module

Slide 85

Slide 85 text

Module in the abstract again!

Slide 86

Slide 86 text

You can even build variations on a module

Slide 87

Slide 87 text

Example module HTML

Slide 88

Slide 88 text

Example module HTML Reference SCSS

Slide 89

Slide 89 text

WHAT ABOUT COMPLEX MODULES? let’s turn this up to 11 - enter UI patterns

Slide 90

Slide 90 text

Alert element

Slide 91

Slide 91 text

Alert element Subject header element

Slide 92

Slide 92 text

Alert element Subject header element Widget header element

Slide 93

Slide 93 text

Alert element Subject header element Widget header element Form select UI Pattern

Slide 94

Slide 94 text

Alert element Subject header element Widget header element Form select UI Pattern Form text entry UI Pattern

Slide 95

Slide 95 text

Button element

Slide 96

Slide 96 text

Button element Radio button, label and text UI pattern

Slide 97

Slide 97 text

Button element Radio button, label and text UI pattern Checkbox and label elements

Slide 98

Slide 98 text

Button element Radio button, label and text UI pattern Checkbox and label elements Scroll box UI pattern

Slide 99

Slide 99 text

Button element Radio button, label and text UI pattern Checkbox and label elements Scroll box UI pattern Calendar data UI pattern

Slide 100

Slide 100 text

Button element Radio button, label and text UI pattern Checkbox and label elements Scroll box UI pattern Calendar data UI pattern Button element

Slide 101

Slide 101 text

Code examples!

Slide 102

Slide 102 text

OMG! This is an error example!

Slide 103

Slide 103 text

OMG! This is an error example! Reuse of elements and patterns with added effect

Slide 104

Slide 104 text

Wow, the markup is the same?

Slide 105

Slide 105 text

Wow, the markup is the same? Just add some ‘fail’ to the blocks and you are AWESOME!

Slide 106

Slide 106 text

WHAT ABOUT THE CODE? how do you build a styleguide?

Slide 107

Slide 107 text

INTRODUCING TOADSTOOL a modern styleguide framework (alpha release)

Slide 108

Slide 108 text

The Sass structure

Slide 109

Slide 109 text

Complex UI groupings The Sass structure

Slide 110

Slide 110 text

UI Elements and core concepts Complex UI groupings The Sass structure

Slide 111

Slide 111 text

The makeup of a Sass module

Slide 112

Slide 112 text

The view structure

Slide 113

Slide 113 text

Complex UI groupings The view structure

Slide 114

Slide 114 text

UI Elements and core concepts Complex UI groupings The view structure

Slide 115

Slide 115 text

The makeup of a markup module

Slide 116

Slide 116 text

ELEMENTS, PATTERNS AND MODULES a recipe for success

Slide 117

Slide 117 text

SUMMARY what have we learned?

Slide 118

Slide 118 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs

Slide 119

Slide 119 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point.

Slide 120

Slide 120 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped.

Slide 121

Slide 121 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped. We can do it better!

Slide 122

Slide 122 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped. We can do it better! Embracing elements, patterns and modules makes our UI code manageable, maintainable and sustainable.

Slide 123

Slide 123 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped. We can do it better! Embracing elements, patterns and modules makes our UI code manageable, maintainable and sustainable. Vanilla CSS frameworks will cause you much pain

Slide 124

Slide 124 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped. We can do it better! Embracing elements, patterns and modules makes our UI code manageable, maintainable and sustainable. Vanilla CSS frameworks will cause you much pain Sass is re-writing the future of CSS.

Slide 125

Slide 125 text

SUMMARY what have we learned? Comps are a failed communication resource between designers and devs As devs, we need to change our contextual starting point. Without common standards; duplicated effort, wild deviations in code and inconsistencies run ramped. We can do it better! Embracing elements, patterns and modules makes our UI code manageable, maintainable and sustainable. Vanilla CSS frameworks will cause you much pain Sass is re-writing the future of CSS. OOCSS is ok, but OOSCSS is amazing!

Slide 126

Slide 126 text

QUESTIONS? you, in the front ...

Slide 127

Slide 127 text

http://speakerrate.com/speakers/15438 You don’t win anything, but it helps me to get better at this ;)

Slide 128

Slide 128 text

https://speakerdeck.com/u/anotheruiguy/p/module-design-ui-dev-patterns

Slide 129

Slide 129 text

No content