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

Tools and Workflow - London Web Standards

Tools and Workflow - London Web Standards

Talk I gave on Tools and Workflow at London Web Standards October 2014

Jonathan Fielding

October 20, 2014
Tweet

More Decks by Jonathan Fielding

Other Decks in Programming

Transcript

  1. @jonthanfielding #lwsanifont What tools can I use to enhance my

    web development? Where do these tools fit in a development workflow?
  2. @jonthanfielding #lwsanifont What do scaffolding tools do? • Setup a

    boilerplate • Install dependencies and sometimes - • configure build tools • setup source control
  3. @jonthanfielding #lwsanifont What are abstractions? • Abstract away from the

    languages of the web • Aim to make development quicker, simpler • Compile to the browsers native language
  4. @jonthanfielding #lwsanifont Examples of abstractions • CSS Preprocessors 
 e.g

    Sass, Stylus and Less • HTML Abstractions 
 e.g HAML, Markdown • Javascript Abstractions 
 e.g Typescript, CoffeeScript, Dart
  5. @jonthanfielding #lwsanifont What is Sass? An abstraction of CSS called

    a 
 CSS pre-processor which is written in Ruby
  6. @jonthanfielding #lwsanifont Sass Syntax @import “variables"; @import “mixins"; .class-name {

    background: #000; p { @include font-size(14px); color: $text-color; span { color: #eee; } } } Import other Sass files Use mixin to generate CSS Nesting Use variable to define color
  7. @jonthanfielding #lwsanifont Compiled CSS /* line 1, ../sass/screen.scss */ .class-name

    { background: #000; } /* line 3, ../sass/screen.scss */ .class-name p { font-size: 14px; color: #fff; } /* line 6, ../sass/screen.scss */ .class-name p span { color: #eee; }
  8. @jonthanfielding #lwsanifont What is Less? An abstraction of CSS called

    a 
 CSS pre-processor which is written in JavaScript
  9. @jonthanfielding #lwsanifont Less Syntax @import “variables.less”; @import “mixin.less” .class-name {

    background: #000; p { .font14(); color: #fff; span { color: #eee; } } } Import other Sass files Use mixin to generate CSS Nesting
  10. @jonthanfielding #lwsanifont Compiled CSS .class-name { background: #000; } .class-name

    p { font-size: 14px; color: #fff; } .class-name p span { color: #eee; }
  11. @jonthanfielding #lwsanifont What is Markdown? A text formatting engine that

    can be compiled into other languages, commonly used to generate HTML
  12. @jonthanfielding #lwsanifont Markdown Syntax #Main Heading ##Secondary Heading Integer posuere

    erat a ante venenatis dapibus posuere velit aliquet. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. ###Todo List * Compile markdown Heading 1 Paragraphs Heading 2 Heading 3 List
  13. @jonthanfielding #lwsanifont Compiled HTML <h1>Main Heading</h1> <h2>Secondary Heading</h2> <p>Integer posuere

    erat a ante venenatis dapibus posuere velit aliquet.</p> <p>Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p> <h3>Todo List</h3> <ul> <li>Compile markdown</li> </ul>
  14. @jonthanfielding #lwsanifont What is Iteration? • Every time we save

    our code and view it in our browser we are creating an iteration of the site • We save, refresh our browser, go back to our editor
  15. @jonthanfielding #lwsanifont What are iteration tools? • Tools that enable

    us to quickly iterate by automating steps we need to take after each save
  16. @jonthanfielding #lwsanifont What is Grunt? Grunt is a task runner

    which enables us to automate tasks by defining tasks it should run
  17. @jonthanfielding #lwsanifont What tasks can Grunt run? • Compilation of

    Abstractions • Unit Testing • Linting • Concatenation • Minification • and many more
  18. @jonthanfielding #lwsanifont Create a Gruntfile.js module.exports = function(grunt) { //Grunt

    configuration goes here grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), }); };
  19. @jonthanfielding #lwsanifont Setting up a task In the Gruntfile.js grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'), compass: { dev: { options: { sassDir: 'sass', cssDir: 'css', imagesDir: 'images', environment: 'development', httpGeneratedImagesPath: ' images' } } } }); Task Target
  20. @jonthanfielding #FrontendTooling Check out my new book • Learn how

    to make your sites responsive • Chapter on development tools and workflow • http://bitly.com/NXusZn • Discount code: 30HT14