style guide driven development: all hail the robot overlords!

55
SENIOR FRONT-END DEVELOPER PREVIOUS NEXT STYLE GUIDE DRIVEN DEVELOPMENT: ALL HAIL THE ROBOT OVERLORDS! JOHN ALBIN WILKINS

Upload: john-albin-wilkins

Post on 16-Apr-2017

495 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Style Guide Driven Development: All Hail the Robot Overlords!

S E N I O R F R O N T - E N D D E V E L O P E R P R E V I O U S N E X T

STYLE GUIDE DRIVEN DEVELOPMENT: ALL HAIL THE ROBOT OVERLORDS!

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

Page 2: Style Guide Driven Development: All Hail the Robot Overlords!

@JOHNALB I NSenior Front-end Developer

Page 3: Style Guide Driven Development: All Hail the Robot Overlords!

Zen Theme Menu Block

Menu Position Fences

Conditional Stylesheets

404 Navigation

Simple aggregation

Zen Grids

Chroma

Normalize-scss

KSS-node

github.com/JohnAlbin

drupal.org/u/johnalbin

Page 4: Style Guide Driven Development: All Hail the Robot Overlords!

QUESTIONS?

Page 5: Style Guide Driven Development: All Hail the Robot Overlords!

WHERE ARE WE HEADED?

Page 6: Style Guide Driven Development: All Hail the Robot Overlords!

HERE’S A SECRET:  NO ONE ELSE REALLY KNOWS

 WHAT THEY’RE DOING EITHER.”

“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

Page 7: Style Guide Driven Development: All Hail the Robot Overlords!

FRONT-END BLOG POSTS:

Grunt/Gulptask runner

Jenkins / CI build tools

npm shrinkwrap / Bundler

Web Components

CSS frameworks Bootstrap / Foundation

CSS/JS linting

Yeoman / Bowerscaffolding tools

Behat / Selenium regression testing

Vagrant Twig / Handlerbars

Sass / LessTravis

YSlowPageSpeed

Cucumber

WraithKSS

Web Starter Kit

Component

CSSLoad

Node.js

Page 8: Style Guide Driven Development: All Hail the Robot Overlords!

“Everyone is describing the one little piece they’ve created, but don’t explain (or even

reference!) the larger concepts of how all of these elements link together.”

— Frank Chimero,July 2014 Designer News AMA

Page 9: Style Guide Driven Development: All Hail the Robot Overlords!

TECHNOLOGY

Page 10: Style Guide Driven Development: All Hail the Robot Overlords!

PROCESS

Page 11: Style Guide Driven Development: All Hail the Robot Overlords!

MAKING SENSE OF FRONT-END TECH

1. Front-end performance

2. Components

3. Continuous Integration

( make shit faster )

( make shit modular )

( automate shit )

Page 12: Style Guide Driven Development: All Hail the Robot Overlords!

WATERFALL PROJECT

Start Deadline

PlanDesign

DevelopTheme

Page 13: Style Guide Driven Development: All Hail the Robot Overlords!

Start Deadline

PlanDesign

DevelopTheme

Tod

ay

WATERFALL PROJECT

Page 14: Style Guide Driven Development: All Hail the Robot Overlords!

REDUCE YOUR R ISKby controlling/minimizing your risk

AG I LE DEVELOPMENT

Page 15: Style Guide Driven Development: All Hail the Robot Overlords!

• Prioritizes project goals

• Completes a set of features

• Creates a releasable product

Each 2-week sprint:

Feature backlogFeature #1

Feature #2

Feature #3

Feature #4

Feature #5

Feature #6

Feature #7

Feature #8

Feature #9

Feature #10Start

Dead

line

Sprint Sprint Sprint Sprint Sprint Sprint Sprint

AG I LE PROJECT

Page 16: Style Guide Driven Development: All Hail the Robot Overlords!

AG I LE + WEB = ?

Page 17: Style Guide Driven Development: All Hail the Robot Overlords!
Page 18: Style Guide Driven Development: All Hail the Robot Overlords!

STYLE-GU IDE-DR IVEN DEVELOPMENT

Only requirements are:

Component-based design and

Automated style guides

Page 19: Style Guide Driven Development: All Hail the Robot Overlords!

“Component” is the same as…

“Object” in OOCSS

“Module” in SMACSS

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

“Web component” in HTML

WHAT IS A DES IGN COMPONENT?

Page 20: Style Guide Driven Development: All Hail the Robot Overlords!

CSS DES IGN 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 21: Style Guide Driven Development: All Hail the Robot Overlords!
Page 22: Style Guide Driven Development: All Hail the Robot Overlords!
Page 23: Style Guide Driven Development: All Hail the Robot Overlords!

SM

AC

SS

BE

M}1.BASE COMPONENTS

2.LAYOUT COMPONENTS

3.COMPONENTS

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 24: Style Guide Driven Development: All Hail the Robot Overlords!

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

.flower

Page 25: Style Guide Driven Development: All Hail the Robot Overlords!

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

.flower_ _ petals

Page 26: Style Guide Driven Development: All Hail the Robot Overlords!

.flower_ _face .flower_ _stem

.flower_ _leaves

Page 27: Style Guide Driven Development: All Hail the Robot Overlords!

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

.flower_ _ bed

Page 28: Style Guide Driven Development: All Hail the Robot Overlords!

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

.flower--tulip

Page 29: Style Guide Driven Development: All Hail the Robot Overlords!

.flower:hover

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 30: Style Guide Driven Development: All Hail the Robot Overlords!

.flower.is-pollinating

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 31: Style Guide Driven Development: All Hail the Robot Overlords!

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

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

Page 32: Style Guide Driven Development: All Hail the Robot Overlords!

3.1.COMPONENT

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN

@media print { .flower }

Page 33: Style Guide Driven Development: All Hail the Robot Overlords!

.is-night .flower3.1.COMPONEN

T

3.2.ELEMENT

3.3.MODIFIER

3.4.STATE

3.5.SKIN( global modifier )

Page 34: Style Guide Driven Development: All Hail the Robot Overlords!

An automated

style guide of

.flower is available:

johnalbin.github.io/flower-power

.flower

Page 35: Style Guide Driven Development: All Hail the Robot Overlords!

DON’T MAKE IT COMPLICATED

.channel-tab_ _guide_ _upcoming-video_ _info_ _time

Page 36: Style Guide Driven Development: All Hail the Robot Overlords!
Page 37: Style Guide Driven Development: All Hail the Robot Overlords!

the names are user-facing

Naming things is hard

if

Page 38: Style Guide Driven Development: All Hail the Robot Overlords!

HOW TO NAME TH INGS:

• Spend 30 seconds to name it • Develop • Spend 5 minutes reflecting (Maybe add a TODO) • Commit • After some time, refactor

Page 39: Style Guide Driven Development: All Hail the Robot Overlords!

DRUPAL 8 CSS COD ING STANDARDS

www.drupal.org/node/1886770

NAMING CONVENTION > NAMES

Page 40: Style Guide Driven Development: All Hail the Robot Overlords!

All the selectors

.the%component+

.the%component%%modifier+

.the%component__an%element+

.the%component%%modifier__an%element+

.the%component.is%state+

+ .the%component:hover+

+ @media+all+{+.the%component+{}+}+

.the%skin+.the%component

Page 41: Style Guide Driven Development: All Hail the Robot Overlords!

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 42: Style Guide Driven Development: All Hail the Robot Overlords!

Selector in DOMI couldn’t change

Class name I wishI could use in DOM

THE “FUGLY” SELECTOR HACK

Page 43: Style Guide Driven Development: All Hail the Robot Overlords!

Style guides are:

documentationfor design systems

Page 44: Style Guide Driven Development: All Hail the Robot Overlords!

Style guides are AMAZING!

Out-of-date style guides are USELESS!

Page 45: Style Guide Driven Development: All Hail the Robot Overlords!

kss-nodegithub.com/kss-node/kss-node

AUTOMATED STYLE GU I DE

Page 46: Style Guide Driven Development: All Hail the Robot Overlords!

KSS: super-simple documentation

Page 47: Style Guide Driven Development: All Hail the Robot Overlords!

AUTOMATED STYLE GUIDE

Page 48: Style Guide Driven Development: All Hail the Robot Overlords!

• Build CSS from Sass/LESS/etc.

• Linting for CSS/Sass/JavaScript

• Build Style Guide

• Visual Regression testing

• Live reload

TASK RUNNER?

Page 49: Style Guide Driven Development: All Hail the Robot Overlords!

LIVE DEMO !!!!

Page 50: Style Guide Driven Development: All Hail the Robot Overlords!

STYLE-GU IDE-DR IVEN DEVELOPMENT

Only requirements are:

Component-based design and

Automated style guides

Page 51: Style Guide Driven Development: All Hail the Robot Overlords!

PROCESS

Page 52: Style Guide Driven Development: All Hail the Robot Overlords!

PROCESS TR I FECTA!

• Designers • Back-end developers • Front-end developers

Page 53: Style Guide Driven Development: All Hail the Robot Overlords!

DECOUPLED DEVELOPMENT

“i love the style guide stuff.Means I can make things pretty!!!”

Actual back-end developer quote:

Page 54: Style Guide Driven Development: All Hail the Robot Overlords!

SO MUCH WIN!

• Designers • Back-end developers • Front-end developers • Clients • Lawyers • Project Managers • even more!

Page 55: Style Guide Driven Development: All Hail the Robot Overlords!

WHAT DID YOU THINK?EVAULATE THIS SESSION - LOSANGELES2015.DRUPAL.ORG/SCHEDULE

THANK YOU!