Rapid Templating with Serve

3e101126b514c65ee531e47bd6281ba3?s=47 Nathan Smith
February 02, 2013

Rapid Templating with Serve

Slides from a talk I gave at the HTML5.tx conference.

Video here…

http://j.mp/rapid-templating

3e101126b514c65ee531e47bd6281ba3?s=128

Nathan Smith

February 02, 2013
Tweet

Transcript

  1. 1.

    Rapid Templating: “DESIGNING IN THE BROWSER” with Sass, Compass, and

    Serve Nathan Smith — Principal UI Architect, projekt202 HTML5.tx — Austin, TX — February 2, 2013
  2. 3.

    Relax, don’t stress out taking notes. You can get the

    slides here… http://j.mp/get-serve
  3. 4.

    It used to be, that you could make a picture

    of a website, chop it up, put it back together with code, and with a little luck, maybe even turn it into a real website! (Confession: I miss those days.)
  4. 5.

    html body * div#id table tbody tr td a.special span

    { /* Dear next developer: Please forgive me! */ color: red !important; } Which isn’t to say we weren’t using CSS…
  5. 8.
  6. 10.
  7. 12.
  8. 13.

    The term “Responsive Web Design” was coined by Ethan Marcotte,

    in an an article published by A List Apart. Loosely defined, it means adapting to various screen sizes, using a fluid grid and @media queries in CSS.
  9. 15.

    Upon hearing about this new design technique, I… 1. Felt

    shock and denial: “Whoa, no way!” 2. Felt guilty for making a fixed-width grid. 3. Bargained: “Maybe it’ll just go away?” 4. Felt depressed, over how little I knew. 5. Started looking up: “Maybe I can learn?” 6. Reconstructed my way of thinking. 7. Felt acceptance and hope: “I can do this!” http://www.recover-from-grief.com/7-stages-of-grief.html
  10. 16.

    Yes, those are (very loosely interpreted) the various stages of

    grief. Essentially, responsive design has both obliterated, and breathed new life into, our field.
  11. 17.
  12. 19.

    Designers “throwing it over the wall” to developers is no

    longer an ideal workflow. Nowadays, all of the cool kids are working collaboratively. http://flickr.com/photos/camknows/8374910613
  13. 21.

    Venerable tools like Photoshop still have their place, but other

    (equally important) front-end tools have arisen as well…
  14. 22.
  15. 23.
  16. 28.

    http://sass-lang.com/editors.html Text editors and IDE’s that support Sass/SCSS syntax Aptana

    http://aptana.org BBEdit http://barebones.com/bbedit Chocolat http://chocolatapp.com Coda http://panic.com/coda E Text Editor http://e-texteditor.com Eclipse http://eclipse.org Emacs http://gnu.org/software/emacs Espresso http://macrabbit.com/espresso GEdit http://projects.gnome.org/gedit Komodo http://activestate.com/komodo-ide Netbeans http://netbeans.org PhpStorm http://jetbrains.com/phpstorm PyCharm http://jetbrains.com/pycharm RubyMine http://jetbrains.com/ruby SubEthaEdit http://codingmonkeys.de/subethaedit Sublime Text http://sublimetext.com/dev TextMate http://macromates.com Vim http://vim.org Visual Studio http://microsoft.com/visualstudio ^ We  recommend
  17. 29.

    For the past two years or so, my preferred approach

    to rapid prototyping templates (with Sass & Compass) has been Serve… http://get-serve.com
  18. 30.
  19. 32.

    Since I can’t show you NDA’d client stuff I’ve made

    using Serve, we are going to look at one of my personal projects. http://unsemantic.com
  20. 33.
  21. 34.
  22. 36.

    Ultimately, what we’re aiming to launch is not a PSD

    file or PDF wireframe. Nor is it the flat HTML, CSS, and JavaScript that comprise a dynamic prototype. Everything except the final product exists just to facilitate the launch. It’s chaff that burns up, once the real thing takes flight. To that end, Serve is like the V of Ruby on Rails’ MVC. It is similar to the “real thing.”
  23. 38.
  24. 44.
  25. 46.
  26. 48.
  27. 50.
  28. 51.

    Bear with me. There’s a point to all of this.

    We’ll get to it. Dude, there’d better be.
  29. 52.
  30. 53.

    So, after all of that, we end up with a

    tightly compiled, single application.css file. Eh? What about all the @import statements? HTTP requests, fool. C’mon man!
  31. 54.
  32. 55.

    That’s the beauty of Sass. If you @import a *.sass

    (or *.scss) file, it becomes part of the single, compiled *.css file. Rage subsiding? Okay, good. Still, why all the @import daisy chaining? Glad you asked! :)
  33. 56.

    ← The astute observers amongst you perhaps have noticed what

    looks like a big compost heap of compiled CSS files. Oh, you saw that? Well…
  34. 69.

    I hate repetitive typing, so I’ve aliased the export command

    — which also recursively creates a *.zip file — to… unsemantic_site_html
  35. 72.

    DEMO TIME! :) Also, don’t forget you can download the

    slides here… http://j.mp/get-serve