styleguide-driven development: the new web development

68
FRONT-END TRACK — OCTOBER 1, 2014 MANAGING COMPLEX PROJECTS WITH DESIGN COMPONENTS JOHN ALBIN WILKINS

Upload: john-albin-wilkins

Post on 17-Nov-2014

501 views

Category:

Software


10 download

DESCRIPTION

The session was originally titled "Managing Complex Projects with Design Components”, but the training I took to become a certified ScrumMaster blew my mind. Integrating agile development with web development is actually very simple. It's called Styleguide-Driven Development. In this session, we will discuss the two requirements for Style Guide Driven Development: component-based design and automated style guides.

TRANSCRIPT

Page 1: Styleguide-Driven Development: The New Web Development

F R O N T - E N D T R A C K — O C T O B E R 1 , 2 0 1 4

MANAG ING COMPLEX PROJECTS WITH DES IGN COMPONENTS

J O H N A L B I N W I L K I N S

Page 2: Styleguide-Driven Development: The New Web Development

@JOHNALB I NSenior Front-end Developer

Page 3: Styleguide-Driven Development: The New Web Development

Zen Gridszengrids.com

!Normalize.css for Sass/Compass

github.com/JohnAlbin/normalize-scss Succinct theme for Colloquy (IRC for Mac)

github.com/JohnAlbin/succinct-for-colloquy git-svn-migrate

john.albin.net/git/git-svn-migrate Zen theme for Drupal drupal.org/project/zen

FREE G I FTS FROM ME

Page 4: Styleguide-Driven Development: The New Web Development

TRIGGER ALERT

This session will mention the word: AGILE

Page 5: Styleguide-Driven Development: The New Web Development

WHERE ARE WE HEADED?

Page 6: Styleguide-Driven Development: The New Web Development

“ARE YOU NEW TO FRONT-END  WEB DEVELOPMENT?

– N I C O L A S G A L L A G H E R

January, 2013

HERE’S A SECRET:  NO ONE ELSE REALLY KNOWS

 WHAT THEY’RE DOING EITHER.”

Page 7: Styleguide-Driven Development: The New Web Development

WHAT THE HELL IS GO I NG ON?

Process Technology

Page 8: Styleguide-Driven Development: The New Web Development

I S THERE A B I GGER P I CTURE?

Grunt/Gulptask runner

Jenkins / CI build tools

npm shrinkwrap / Bundler

Web Components

CSS frameworks Bootstrap / Foundation

CSS/JS linting

Yeoman / Bower!scaffolding tools

Behat / Selenium regression testing

Vagrant Twig / Handlerbars

Sass / Less

Page 9: Styleguide-Driven Development: The New Web Development

I S THERE A B I GGER P I CTURE?

Grunt/Gulptask runner

Jenkins / CI build tools

npm shrinkwrap / Bundler

Web Components

CSS frameworks Bootstrap / Foundation

CSS/JS linting

Yeoman / Bower!scaffolding tools

Behat / Selenium regression testing

Vagrant Twig / Handlerbars

Sass / LessTravis

YSlow

PageSpeed

Cucumber

WraithKSS

Web Starter Kit

Component

CSSLoad

Node.js

Page 10: Styleguide-Driven Development: The New Web Development

I S THERE A B I GGER P I CTURE?

Continuous Integration

Component Library

Page 11: Styleguide-Driven Development: The New Web Development

I S THERE A B I GGER P I CTURE?

Continuous Integration

Component Library

are documented by!style guides

Agile Development!requires

Page 12: Styleguide-Driven Development: The New Web Development

Start Deadline

PlanDesign

DevelopTheme

WATERFALL PROJECT

Page 13: Styleguide-Driven Development: The New Web Development

WATERFALL PROJECT

Start Deadline

Plan

Design

Develop

Theme

Tod

ay

Page 14: Styleguide-Driven Development: The New Web Development

Agile development

Page 15: Styleguide-Driven Development: The New Web Development

Reduce your risk

by controlling/minimizing your risk

Page 16: Styleguide-Driven Development: The New Web Development

AG I LE PROJECTFeature backlog

Feature #1

Feature #2

Feature #3

Feature #4

Feature #5

Feature #6

Feature #7

Feature #8

Feature #9

Feature #10

Start

Dead

line

Sprint Sprint Sprint Sprint Sprint Sprint Sprint

Page 17: Styleguide-Driven Development: The New Web Development

AG I LE PROJECT

• Prioritizes project goals

• Completes a set of features

• Creates a releasable product

Each 2-week sprint:

Feature backlog

Feature #1

Feature #2

Feature #3

Feature #4

Feature #5

Feature #6

Feature #7

Feature #8

Feature #9

Feature #10

Start

Dead

line

Sprint Sprint Sprint Sprint Sprint Sprint Sprint

Page 18: Styleguide-Driven Development: The New Web Development

AGILE + WEB = ?

Component-based design +

Automated style guides

Page 19: Styleguide-Driven Development: The New Web Development

F R O N T - E N D T R A C K — O C T O B E R 1 , 2 0 1 4

STYLEGU IDE-DR IVEN DEVELOPMENT: THE NEW WEB DEVELOPMENT

J O H N A L B I N W I L K I N S

Page 20: Styleguide-Driven Development: The New Web Development

STYLE GUIDE DRIVEN DEVELOPMENT

Only requirements are:

Component-based design and

Automated style guides

Page 21: Styleguide-Driven Development: The New Web Development

What are we doing wrong?

Page 22: Styleguide-Driven Development: The New Web Development

CSS SPECIFICITY

WARSCSS

SPECIFICITY WARS

Page 23: Styleguide-Driven Development: The New Web Development

.menu .item a:link {}!

.sidebar .menu .item a:link {}!

.page-37 .sidebar .menu .item a:link {}

CSS SPEC I F I C ITY WARS

Page 24: Styleguide-Driven Development: The New Web Development

.menu .item a:link {! .sidebar & {! .page-37 & {}! }!}

CSS SPEC I F I C ITY WARS

Page 25: Styleguide-Driven Development: The New Web Development

OVERLY GENER I C CLASS NAMES.title&{&}

.block&.title&{&}

.node&.title&{&}

.views&.title&{&}

.content&{&}

.block&.content&{&}

.node&.content&{&}

.views&.content&{&}

Page 26: Styleguide-Driven Development: The New Web Development

SEEMED L I KE A GOOD I D EA AT THE TIME

Page 27: Styleguide-Driven Development: The New Web Development

“Component” is the same as…

⨯ “Object” in OOCSS

⨯ “Module” in SMACSS

⨯ “Block” in BEM’s Block-Element-Modifier

⨯ “UI Pattern”

WHAT IS A D ES I GN COMPONENT?

Page 28: Styleguide-Driven Development: The New Web Development

CSS DES I GN COMPONENTS ARE:⨯ Applied to a loose collection of HTML elements

⨯ Repeatable (even if never repeated)

⨯ SpecificReplace CSS specificity with specific names

⨯ Self containedStyles do not bleed onto anything else

⨯ Nest-able

Page 29: Styleguide-Driven Development: The New Web Development
Page 30: Styleguide-Driven Development: The New Web Development
Page 31: Styleguide-Driven Development: The New Web Development

SMACSS1.BASE

2.LAYOUT

3.MODULE

4.STATE

5.THEME

Page 32: Styleguide-Driven Development: The New Web Development

SMACSS1.BASE

2.LAYOUT

3.COMPONENTS

4.STATE

5.SKIN

1.BASE

2.LAYOUT

3.MODULE

4.STATE

5.THEME

Page 33: Styleguide-Driven Development: The New Web Development

SM

AC

SS

1.BASE

2.LAYOUT

3.COMPONENTS

4.STATE

5.SKIN

Page 34: Styleguide-Driven Development: The New Web Development

SM

AC

SS

1.BASE

2.LAYOUT

3.COMPONENTS

3.1.STATE

3.2.SKIN

Page 35: Styleguide-Driven Development: The New Web Development

SM

AC

SS

BE

M}1.BASE

2.LAYOUT

3.COMPONENTS

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 36: Styleguide-Driven Development: The New Web Development

“You see, radio is a kind of a very, very long           .cat.

Page 37: Styleguide-Driven Development: The New Web Development

You pull his tail in New York and his head is

meowing in Los Angeles.

Page 38: Styleguide-Driven Development: The New Web Development

Do you understand this? You send signals here, they

receive them there. The only difference is that…

Page 39: Styleguide-Driven Development: The New Web Development

…there is no cat.”

— Albert Einstein

Page 40: Styleguide-Driven Development: The New Web Development

!

3.1.COMPONENT 3.2.ELEMENT 3.3.MOD I F I ER 3.4.STATE 3.5.SK I N

.flower

Page 41: Styleguide-Driven Development: The New Web Development

!

3.1.COMPONENT 3.2.ELEMENT 3.3.MOD I F I ER 3.4.STATE 3.5.SK I N

.flower_ _ petals

Page 42: Styleguide-Driven Development: The New Web Development

.flower_ _face .flower_ _stem

.flower_ _leaves

Page 43: Styleguide-Driven Development: The New Web Development

!

3.1.COMPONENT 3.2.ELEMENT 3.3.MOD I F I ER 3.4.STATE 3.5.SK I N

.flower_ _ bed

Page 44: Styleguide-Driven Development: The New Web Development

!

3.1.COMPONENT 3.2.ELEMENT 3.3.MOD I F I ER 3.4.STATE 3.5.SK I N

.flower--tulip

Page 45: Styleguide-Driven Development: The New Web Development

Don’t make it complicated

.channel-tab_ _guide_ _upcoming-video_ _info_ _time

Page 46: Styleguide-Driven Development: The New Web Development

Don’t make it complicated

.channel-tab_ _guide_ _upcoming-video_ _info_ _time

Page 47: Styleguide-Driven Development: The New Web Development

⨯ Content semantics are handled by HTML5 elements

⨯ Let’s make our class names use Design semantics

⨯ Class names should be meaningful to developers and designers

On semantic naming

Page 48: Styleguide-Driven Development: The New Web Development

.flower:hover!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 49: Styleguide-Driven Development: The New Web Development

.flower.is-pollinating!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 50: Styleguide-Driven Development: The New Web Development

@media (min-width: 48em) { .flower }!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 51: Styleguide-Driven Development: The New Web Development

!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

@media print { .flower }

Page 52: Styleguide-Driven Development: The New Web Development

.is-night .flower!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN ( global modfier )

Page 53: Styleguide-Driven Development: The New Web Development

An automated

style guide of

.flower is available: !

johnalbin.github.io/flower-power

.flower

Page 54: Styleguide-Driven Development: The New Web Development

All the selectors.the3component&

.the3component33modifier&

.the3component__an3element&

.the3component33modifier__an3element&

.the3component.is3state&

& .the3component:hover&

& @media&all&{&.the3component&{}&}&

.the3skin&.the3component

Page 55: Styleguide-Driven Development: The New Web Development

CSS DES I GN COMPONENTS ARE:⨯ Applied to a loose collection of HTML elements

⨯ Repeatable (even if never repeated)

⨯ SpecificReplace CSS specificity with specific names

⨯ Self containedStyles do not bleed onto anything else

⨯ Nest-able

Page 56: Styleguide-Driven Development: The New Web Development

SM

AC

SS

BE

M}1.BASE

2.LAYOUT

3.COMPONENTS

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 57: Styleguide-Driven Development: The New Web Development

Drupal 8 CSS coding standards

www.drupal.org/node/1886770

Page 58: Styleguide-Driven Development: The New Web Development

F I LE ORGAN IZATI ON = 3 SMACSS CATEGORI ES

Page 59: Styleguide-Driven Development: The New Web Development

S IMPLE SASS SETUP

Page 60: Styleguide-Driven Development: The New Web Development

STYLES.SCSS

Page 61: Styleguide-Driven Development: The New Web Development

S IMPLE FO LDER STRUCTURE

Page 62: Styleguide-Driven Development: The New Web Development

EASY TO F I ND YOUR COMPONENTS.

⨯ Inspect the DOM.

⨯ Find the CSS class on the

component.

⨯ Look for a file with that

name in the components

folder.

Page 63: Styleguide-Driven Development: The New Web Development

THE “Fugly” SELECTOR HACK

Page 64: Styleguide-Driven Development: The New Web Development

THE “Fugly” SELECTOR HACK

Selector in DOMI couldn’t change

Class name I wishI could use in DOM

Page 65: Styleguide-Driven Development: The New Web Development

AUTOMATED STYLE GUIDE

kss-node github.com/kss-node/kss-node

Page 66: Styleguide-Driven Development: The New Web Development

AUTOMATED STYLE GUIDE

Page 67: Styleguide-Driven Development: The New Web Development
Page 68: Styleguide-Driven Development: The New Web Development

WHAT D ID YOU TH INK?E V A U L A T E T H I S S E S S I O N - A M S T E R D A M 2 0 1 4 . D R U P A L . O R G / S C H E D U L E

THANK YOU!