Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Front-End Style Guides

Front-End Style Guides

From the Tech For Good & Front-End Innovators meet-up at DoSomething.org on June 23rd 2014.

A number of websites such as GitHub, BBC and CodeForAmerica utilize live style guides to enforce visual consistency throughout their site and facilitate rapid building of user interfaces. You can think of a style guide as a living document of your front-end code and design decisions, outlining the elements and patterns used throughout your website.

Front-End focused Software Engineers David Furnes and Diego Lorenzo will talk through how we created our Style Guide and Pattern Library - http://neue.dosomething.org - and how we use it on a daily basis at DoSomething.org.

You can watch a video of this talk on YouTube at: https://www.youtube.com/watch?v=4hrQ7XVjsSQ

David Furnes

June 23, 2014
Tweet

More Decks by David Furnes

Other Decks in Programming

Transcript

  1. BBC

  2. PART ONE Why a style guide? PART TWO Introducing Neue

    PART THREE How it’s made PART FOUR The Future
  3. Form fields Intra-page links Headings Modals Form validation Status messages

    Call-to-action banners Layout containers Galleries Campaign tiles Page headers Text callouts Legal text Smooth-scrolling Image borders Tabbed navigation Site chrome
  4. Form fields Image borders Tabbed navigation Intra-page links Headings Modals

    Form validation Status messages Call-to-action banners Layout containers Galleries Campaign tiles Page headers Site chrome Text callouts Legal text Smooth-scrolling
  5. Form fields Intra-page links Headings Modals Form validation Status messages

    Call-to-action banners Layout containers Galleries Campaign tiles Page headers Text callouts Legal text Smooth-scrolling Image borders Tabbed navigation Site chrome
  6. Form fields Intra-page links Headings Modals Form validation Status messages

    Call-to-action banners Layout containers Galleries Campaign tiles Page headers Text callouts Legal text Smooth-scrolling Image borders Tabbed navigation Site chrome
  7. Form fields Intra-page links Headings Modals Form validation Status messages

    Call-to-action banners Layout containers Galleries Campaign tiles Page headers Text callouts Legal text Smooth-scrolling Image borders Tabbed navigation Site chrome
  8. KSS

  9. // Button styles for both input and anchor buttons. //

    Suitable for all-purpose use. // // :hover - Subtle hover state (will not be // displayed on touch interfaces) // :focus - Focus state for users navigating // the page using tab keys. // :active - "Pushed" button state // .disabled - Disabled (non-interactive) button // state. Consider removing button // from interface if not necessary to // avoid confusion. // .loading - AJAX loading animation. Used when // loading results inline. ==Must be // used on `a` or `button`. Will not // work with `input` elements.==
  10. // Button styles for both input and anchor buttons. //

    Suitable for all-purpose use. // // :hover - Subtle hover state (will not be // displayed on touch interfaces) // :focus - Focus state for users navigating // the page using tab keys. // :active - "Pushed" button state // .disabled - Disabled (non-interactive) button // state. Consider removing button // from interface if not necessary to // avoid confusion. // .loading - AJAX loading animation. Used when // loading results inline. ==Must be // used on `a` or `button`. Will not // work with `input` elements.==
  11. // Status message styles. These should be used to provide

    // feedback to the user for events that occur outside the // normal application flow (such as form validation // errors). ==Close button is added using JavaScript. See // `system-messages.js`.== // // .error - Used to display errors. Be careful not to // blame the user for a mistake. // // Styleguide 4.1.8 - Status Banners ! .messages { position: relative; width: 100%; background: $purple; text-align: left;
  12. // Status message styles. These should be used to provide

    // feedback to the user for events that occur outside the // normal application flow (such as form validation // errors). ==Close button is added using JavaScript. See // `system-messages.js`.== // // .error - Used to display errors. Be careful not to // blame the user for a mistake. // // Styleguide 4.1.8 - Status Banners ! .messages { position: relative; width: 100%; background: $purple; text-align: left;
  13. // Status message styles. These should be used to provide

    // feedback to the user for events that occur outside the // normal application flow (such as form validation // errors). ==Close button is added using JavaScript. See // `system-messages.js`.== // // .error - Used to display errors. Be careful not to // blame the user for a mistake. // // Styleguide 4.1.8 - Status Banners ! .messages { position: relative; width: 100%; background: $purple; text-align: left;
  14. .container { ! > .wrapper { padding: 1rem; position: relative;

    @include clearfix(); ! @include media($tablet) { ! } } ! }
  15. .container { ! > .wrapper { padding: 1rem; position: relative;

    @include clearfix(); ! @include media($tablet) { @include span-columns(12); } } ! }
  16. .container { ! > .wrapper { padding: 1rem; position: relative;

    @include clearfix(); ! @include media($tablet) { @include span-columns(12); @include shift(2); } } ! }
  17. .block { } .block__element { } .block--modifier { } //

    but shit gets cray: .block__element--modifier { } .block__element--modifier__element { }
  18. <article class="tile tile--campaign"> <a class="wrapper" href="#"> <div class="tile--meta"> <h1 class="__title">Kittens</h1>

    <p class=“__tagline">They are sometimes cute.</p> </div> <img src="http://placekitten.com/g/600/600" /> </a> </article>
  19. dosomething/bower.json ! { “name: “dosomething”, “dependencies”: { “neue”: “DoSomething/neue#~4.0.0”, “jquery”:

    “1.8.3”, “html5shiv”: “~3.7.0”, “lodash”: “~2.4.1”, /* ... */ }, /* ... */ }
  20. neue/bower.json ! { “name: “neue”, “version”: “4.0.10”, “main”: [ “dist/neue.css”,

    “dist/neue.min.js” ], "dependencies": { "jquery": ">=1.7.2" }, /* ... */ }
  21. neue/bower.json ! { “name: “neue”, “version”: “4.0.10”, “main”: [ “dist/neue.css”,

    “dist/neue.min.js” ], "dependencies": { "jquery": ">=1.7.2" }, /* ... */ }
  22. <article class="tile tile--campaign"> <a class="wrapper" href="#"> <div class="tile--meta"> <h1 class="__title">Kittens</h1>

    <p class=“__tagline">They are sometimes cute.</p> </div> <img src="http://placekitten.com/g/600/600" /> </a> </article>
  23. <article class="tile tile--campaign"> <a class="wrapper" href="#"> <div class="tile--meta"> <h1 class="__title">Kittens</h1>

    <p class=“__tagline">They are sometimes cute.</p> </div> <img src="http://placekitten.com/g/600/600" /> </a> </article>