style guide driven development
play

STYLE GUIDE DRIVEN DEVELOPMENT: ALL HAIL THE ROBOT OVERLORDS! J O - PowerPoint PPT Presentation

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 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 @JOHNALBIN Senior Front-end Developer github.com drupal.org


  1. 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 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

  2. @JOHNALBIN Senior Front-end Developer

  3. github.com drupal.org /JohnAlbin /u/johnalbin Zen Theme Menu Block Zen Grids Menu Position Fences Normalize-scss Conditional Stylesheets KSS-node 404 Navigation Chroma Simple aggregation

  4. QUESTIONS?

  5. WHERE ARE WE HEADED?

  6. “ARE YOU NEW TO FRONT-END WEB DEVELOPMENT? HERE’S A SECRET: NO ONE ELSE REALLY KNOWS WHAT THEY’RE DOING EITHER.” – N I C O L A S G A L L A G H E R January, 2013

  7. FRONT-END BLOG POSTS: Twig / Handlerbars Vagrant npm shrinkwrap / Bundler Travis Component Grunt/Gulp 
 Jenkins / CI Sass / Less task runner build tools KSS Wraith Web Components Behat / Selenium Node.js PageSpeed regression testing YSlow CSS/JS linting Cucumber CSS frameworks Web Starter Kit Yeoman / Bower Bootstrap / Foundation CSSLoad scaffolding tools

  8. “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

  9. TECHNOLOGY

  10. PROCESS

  11. MAKING SENSE OF FRONT-END TECH 1. Front-end ( make shit faster ) performance ( make shit modular ) 2. Components 3. Continuous ( automate shit ) Integration

  12. WATERFALL PROJECT Plan Design Develop Theme Start Deadline

  13. � � � � WATERFALL PROJECT Plan Design Develop Theme Today Start Deadline

  14. AGILE DEVELOPMENT REDUCE YOUR RISK by controlling/minimizing your risk

  15. AGILE PROJECT Feature Sprint Sprint Sprint Sprint Sprint Sprint Sprint backlog Feature #1 Feature #2 Feature #3 Each 2-week sprint: Feature #4 Feature #5 • Prioritizes project goals Deadline Feature #6 • Completes a set of features Start Feature #7 • Creates a releasable Feature #8 product Feature #9 Feature #10

  16. AGILE + WEB = ?

  17. STYLE-GUIDE-DRIVEN DEVELOPMENT Only requirements are: Component-based design and Automated style guides

  18. WHAT IS A DESIGN COMPONENT? “Component” is the same as… “Object” in OOCSS “Module” in SMACSS “Block” in BEM’s Block-Element-Modifier “Web component” in HTML

  19. CSS DESIGN COMPONENTS ARE: • Applied to a loose collection of HTML elements • Repeatable 
 (even if never repeated) • Specific 
 Replace CSS specificity with specific names • Self contained 
 Styles do not bleed onto anything else • Nest-able

  20. SMACSS 1.BASE COMPONENTS 2.LAYOUT COMPONENTS BEM 3.COMPONENTS } 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  21. .flower 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  22. .flower_ _ petals 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  23. .flower_ _face .flower_ _stem .flower_ _leaves

  24. .flower_ _ bed 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  25. .flower--tulip 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  26. .flower:hover 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  27. .flower.is-pollinating 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  28. @media (min-width: 48em) { .flower } 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  29. @media print { .flower } 3.1.COMPONENT 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE 3.5.SKIN

  30. .is-night .flower 3.1.COMPONEN T 3.2.ELEMENT 3.3.MODIFIER 3.4.STATE ( global modifier ) 3.5.SKIN

  31. .flower An automated style guide of .flower is available: johnalbin.github.io/flower-power

  32. DON’T MAKE IT COMPLICATED .channel-tab_ _guide_ _upcoming-video_

  33. Naming things is hard if the names are user-facing

  34. HOW TO NAME THINGS: • Spend 30 seconds to name it • Develop • Spend 5 minutes reflecting (Maybe add a TODO) • Commit • After some time, refactor

  35. NAMING CONVENTION > NAMES DRUPAL 8 
 CSS CODING STANDARDS www.drupal.org/node/1886770

  36. 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

  37. EASY TO FIND YOUR COMPONENTS. • Inspect the DOM. • Find the CSS class on the component. • Look for a file with that name in the components folder.

  38. THE “FUGLY” SELECTOR HACK Selector in DOM 
 I couldn’t change Class name I wish 
 I could use in DOM

  39. Style guides are: documentation 
 for design systems

  40. Style guides are AMAZING! Out-of-date style guides are USELESS!

  41. AUTOMATED STYLE GUIDE kss-node 
 github.com/kss-node/kss-node

  42. KSS: super-simple documentation

  43. AUTOMATED STYLE GUIDE

  44. TASK RUNNER? • Build CSS from Sass/LESS/etc. • Linting for CSS/Sass/JavaScript • Build Style Guide • Visual Regression testing • Live reload

  45. LIVE DEMO !!!!

  46. STYLE-GUIDE-DRIVEN DEVELOPMENT Only requirements are: Component-based design and Automated style guides

  47. PROCESS

  48. PROCESS TRIFECTA! • Designers • Back-end developers • Front-end developers

  49. DECOUPLED DEVELOPMENT Actual back-end developer quote: “i love the style guide stuff. Means I can make things pretty!!!”

  50. SO MUCH WIN! • Designers • Back-end developers • Front-end developers • Clients • Lawyers • Project Managers • even more!

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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend