SlideShare ist ein Scribd-Unternehmen logo
1 von 72
Downloaden Sie, um offline zu lesen
Rapid Templating:
“DESIGNING IN THE BROWSER”
with Sass, Compass, and Serve
  Nathan Smith — Principal UI Architect, projekt202
     HTML5.tx — Austin, TX — February 2, 2013
I do mobile/web
UX + JavaScript at



 (me, on Twitter: @nathansmith)


          http://projekt202.com
Relax, don’t stress out
taking notes. You can
get the slides here


http://j.mp/get-serve
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.)
Which isn’t to say we weren’t using CSS



  html body * div#id table
  tbody tr td a.special span {
    /*
      Dear next developer:
      Please forgive me!
    */
    color: red !important;
  }

but at least we had a reliable design workïŹ‚ow.
Then this happened

Which of course,
now looks like this

And, can dynamically
 change into this

The term “Responsive Web Design”
was coined by Ethan Marcotte, in an
an article published by A List Apart.

Loosely deïŹned, it means adapting
to various screen sizes, using a ïŹ‚uid
grid and @media queries in CSS.
Ethan also wrote a book





  http://abookapart.com/products/responsive-web-design
Upon hearing about this
new design technique, I

1. Felt shock and denial: “Whoa, no way!”
2. Felt guilty for making a ïŹxed-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
Yes, those are (very loosely
interpreted) the various
stages of grief. Essentially,
responsive design has both
obliterated, and breathed
new life into, our ïŹeld.
Like accessibility, RWD works best with advanced planning





#FAIL
Designers “throwing it over
the wall” to developers is no
longer an ideal workïŹ‚ow.

Nowadays, all of the cool kids
are working collaboratively.

       http://ïŹ‚ickr.com/photos/camknows/8374910613
We’ve had to rethink our vantage point.
Venerable tools like Photoshop
still have their place, but other
(equally important) front-end
tools have arisen as well

Neatly organized *.sass                                      CSS served to browser




 http://thingsorganizedneatly.tumblr.com/post/9494864300/submission-the-compulsively-tidy-ursus-wehrli
CSS                    Sass                             Compass
      http://sonspring.com/journal/sass-for-designers
Compass makes vendor preïŹxes easy...
Compass brings sanity to gradients...
Text editors and IDE’s that support Sass/SCSS syntax

         Aptana                              BBEdit                             Chocolat                              Coda
       http://aptana.org            http://barebones.com/bbedit             http://chocolatapp.com              http://panic.com/coda




     E Text Editor                          Eclipse                               Emacs                            Espresso
    http://e-texteditor.com               http://eclipse.org             http://gnu.org/software/emacs      http://macrabbit.com/espresso




           GEdit                           Komodo                              Netbeans                           PhpStorm
http://projects.gnome.org/gedit   http://activestate.com/komodo-ide           http://netbeans.org           http://jetbrains.com/phpstorm




       PyCharm                            RubyMine                           SubEthaEdit                        Sublime Text




                                                                                                                      ^
 http://jetbrains.com/pycharm         http://jetbrains.com/ruby       http://codingmonkeys.de/subethaedit    http://sublimetext.com/dev




       TextMate                                Vim                           Visual Studio
                                                                                                                         nd
   http://macromates.com                    http://vim.org             http://microsoft.com/visualstudio
                                                                                                             We  recomme




                                                  http://sass-lang.com/editors.html
For the past two years or so, my preferred
approach to rapid prototyping templates
(with Sass & Compass) has been Serve


http://get-serve.com
Continuing the analogy, Serve is like





        http://hdwallpapers.in/the_avengers-wallpapers.html
Since I can’t show you NDA’d client stuïŹ€
 I’ve made using Serve, we are going to
   look at one of my personal projects.

   http://unsemantic.com
I think of wireframes and prototypes like this





           http://blogs.pennmanor.net/hstsa/nasa/nasa-space-project
Ultimately, what we’re aiming to launch is
not a PSD ïŹle or PDF wireframe. Nor is it
the ïŹ‚at HTML, CSS, and JavaScript that
comprise a dynamic prototype.

Everything except the ïŹnal product exists
just to facilitate the launch. It’s chaïŹ€ that
burns up, once the real thing takes ïŹ‚ight.

To that end, Serve is like the V of Ruby on
Rails’ MVC. It is similar to the “real thing.”
This is the index.html.erb home page “view” ïŹle.
_layout.html.erb points to application.html.erb




               This ïŹle has one code snippet


               <%= render :template =>
               "/layouts/application" %>
<%= yield %> outputs the view ïŹle (index, etc.)
This ïŹle also renders the <head> partial.
Which then renders the stylesheets partial.
That has all sorts of interesting goodies.
Next up, let’s look at the
Sass variables partial

Which is imported by
 the base grid ïŹle


    Okay, cool.
Which is imported by
the responsive partial


Eh? Another @import?
Which is ïŹnally imported
 by application.sass


 Seriously, what the?
Bear with me. There’s a point
 to all of this. We’ll get to it.

  Dude, there’d better be.
So, after all of that, we end
up with a tightly compiled,
single application.css ïŹle.

Eh? What about all the
@import statements? HTTP
requests, fool. C’mon man!
That’s the beauty of Sass. If you
@import a *.sass (or *.scss)
ïŹle, it becomes part of the
single, compiled *.css ïŹle.

Rage subsiding? Okay, good.
Still, why all the @import daisy
chaining? Glad you asked! :)
← The astute observers
  amongst you perhaps
  have noticed what looks
  like a big compost heap
  of compiled CSS ïŹles.

  Oh, you saw that? Well

Most of those ïŹles aren’t used directly, but


exist to show grid CSS, apart from the site.
Those are also the ïŹ‚at CSS ïŹles on GitHub.
This is why grid code is in separate partials

Hat tip to Nicolas Gallagher for the idea!
Yep. I can identify with that! :)
Maybe I (don’t) know what
I’m doing. Here’s an idea

Simple view helper function, named “html”
Variable set in
 /views/partials/_vars.html.erb
Then, we do/don't end links with *.html
Further evidence that I (probably
  don't) know what I'm doing

A voodoo-magic Z shell (or Bash) recipe

I hate repetitive typing, so I’ve aliased
the export command — which also
recursively creates a *.zip ïŹle — to


unsemantic_site_html
Being lazy, FTW
 Computer, do my bidding!
That builds all the ïŹ‚at ïŹles, and a *.zip of it all

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


  http://j.mp/get-serve

Weitere Àhnliche Inhalte

Was ist angesagt?

Was ist angesagt? (11)

Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8
 
Javascript native OOP - 3 layers
Javascript native OOP - 3 layers Javascript native OOP - 3 layers
Javascript native OOP - 3 layers
 
My best grunt
My best gruntMy best grunt
My best grunt
 
Windows Azure loves OSS
Windows Azure loves OSSWindows Azure loves OSS
Windows Azure loves OSS
 
Avoiding common Accessibility mistakes
Avoiding common Accessibility mistakesAvoiding common Accessibility mistakes
Avoiding common Accessibility mistakes
 
ISTE 2016 - Custom 3D for AR
ISTE 2016 - Custom 3D for ARISTE 2016 - Custom 3D for AR
ISTE 2016 - Custom 3D for AR
 
Real solutions, no tricks
Real solutions, no tricksReal solutions, no tricks
Real solutions, no tricks
 
Javascript fullstasck
Javascript fullstasckJavascript fullstasck
Javascript fullstasck
 
The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014
 
Practical guide for front-end development for django devs
Practical guide for front-end development for django devsPractical guide for front-end development for django devs
Practical guide for front-end development for django devs
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next Generation
 

Andere mochten auch

JdbcTemplate aus Spring
JdbcTemplate aus SpringJdbcTemplate aus Spring
JdbcTemplate aus Spring
tutego
 
Children’S Rights Practicum
Children’S Rights PracticumChildren’S Rights Practicum
Children’S Rights Practicum
trammai
 
P161_Vietnam_Economics_Quarter_1_2008
P161_Vietnam_Economics_Quarter_1_2008P161_Vietnam_Economics_Quarter_1_2008
P161_Vietnam_Economics_Quarter_1_2008
internationalvr
 
What do you need to run
What do you need to runWhat do you need to run
What do you need to run
Runniing Livinig
 
My Open Archive
My Open ArchiveMy Open Archive
My Open Archive
Keita Bando
 
Self Organized Air Tasking
Self Organized Air TaskingSelf Organized Air Tasking
Self Organized Air Tasking
John Bordeaux
 
Curriculumlibrary Present
Curriculumlibrary PresentCurriculumlibrary Present
Curriculumlibrary Present
Steve Kashdan
 
Camtasia relay presentation final
Camtasia relay presentation finalCamtasia relay presentation final
Camtasia relay presentation final
Steve Kashdan
 

Andere mochten auch (20)

JdbcTemplate aus Spring
JdbcTemplate aus SpringJdbcTemplate aus Spring
JdbcTemplate aus Spring
 
DSVC Design Talk
DSVC Design TalkDSVC Design Talk
DSVC Design Talk
 
The Cave
The CaveThe Cave
The Cave
 
Children’S Rights Practicum
Children’S Rights PracticumChildren’S Rights Practicum
Children’S Rights Practicum
 
Gospelcon 2006
Gospelcon 2006Gospelcon 2006
Gospelcon 2006
 
P161_Vietnam_Economics_Quarter_1_2008
P161_Vietnam_Economics_Quarter_1_2008P161_Vietnam_Economics_Quarter_1_2008
P161_Vietnam_Economics_Quarter_1_2008
 
What do you need to run
What do you need to runWhat do you need to run
What do you need to run
 
My Open Archive
My Open ArchiveMy Open Archive
My Open Archive
 
Omega USPs
Omega USPsOmega USPs
Omega USPs
 
Beekman5 std ppt_01
Beekman5 std ppt_01Beekman5 std ppt_01
Beekman5 std ppt_01
 
Blocks Extensible Exchange Protocol
Blocks Extensible Exchange  ProtocolBlocks Extensible Exchange  Protocol
Blocks Extensible Exchange Protocol
 
Jenn 6 C 2
Jenn 6 C 2Jenn 6 C 2
Jenn 6 C 2
 
Self Organized Air Tasking
Self Organized Air TaskingSelf Organized Air Tasking
Self Organized Air Tasking
 
Beekman5 std ppt_04
Beekman5 std ppt_04Beekman5 std ppt_04
Beekman5 std ppt_04
 
Beekman5 std ppt_14
Beekman5 std ppt_14Beekman5 std ppt_14
Beekman5 std ppt_14
 
Curriculumlibrary Present
Curriculumlibrary PresentCurriculumlibrary Present
Curriculumlibrary Present
 
Nectec Digital Archive Concept
Nectec Digital Archive ConceptNectec Digital Archive Concept
Nectec Digital Archive Concept
 
Online Video Format Experiment
Online Video Format ExperimentOnline Video Format Experiment
Online Video Format Experiment
 
Camtasia relay presentation final
Camtasia relay presentation finalCamtasia relay presentation final
Camtasia relay presentation final
 
Tle I And Ii Know More About Self
Tle I And Ii   Know More About SelfTle I And Ii   Know More About Self
Tle I And Ii Know More About Self
 

Ähnlich wie Rapid Templating with Serve

Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
Spike Brehm
 
960 grid psd
960 grid psd960 grid psd
960 grid psd
Raju Nag
 
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
Koji Ishimoto
 

Ähnlich wie Rapid Templating with Serve (20)

Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
CCSP 2012F æ—©é»žäž‹ç­çš„ć·„ć…·
CCSP 2012F æ—©é»žäž‹ç­çš„ć·„ć…· CCSP 2012F æ—©é»žäž‹ç­çš„ć·„ć…·
CCSP 2012F æ—©é»žäž‹ç­çš„ć·„ć…·
 
3d web
3d web3d web
3d web
 
CSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdfCSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdf
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web Design
 
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript
 
Fowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing WorkshopFowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing Workshop
 
Using Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsUsing Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion Dollars
 
HTML5 for Web Designers
HTML5 for Web DesignersHTML5 for Web Designers
HTML5 for Web Designers
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
 
Lightning fast sass
Lightning fast sassLightning fast sass
Lightning fast sass
 
How i made the responsive mobile version of
How i made the responsive mobile version ofHow i made the responsive mobile version of
How i made the responsive mobile version of
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
960 grid psd
960 grid psd960 grid psd
960 grid psd
 
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
ăƒ•ăƒ­ăƒłăƒˆă‚šăƒłăƒ‰ă‚šăƒłă‚žăƒ‹ă‚ąïŒˆä»źïŒ‰ ă€œăˆă€ăĄă‚‡ăŁăšăƒ•ăƒ­ăƒłăƒˆă‚„ă‚‹ă“ăšć€šă™ăŽă˜ă‚ƒăȘă„ïŒïŒŸă€œ
 
[H3 2012] ìš°ëŠŹê°€ ëȘšë„ŽëŠ” Node.js로 할 수 있는 ëȘ‡ê°€ì§€
[H3 2012] ìš°ëŠŹê°€ ëȘšë„ŽëŠ” Node.js로 할 수 있는 ëȘ‡ê°€ì§€[H3 2012] ìš°ëŠŹê°€ ëȘšë„ŽëŠ” Node.js로 할 수 있는 ëȘ‡ê°€ì§€
[H3 2012] ìš°ëŠŹê°€ ëȘšë„ŽëŠ” Node.js로 할 수 있는 ëȘ‡ê°€ì§€
 

Mehr von Nathan Smith

Mehr von Nathan Smith (20)

Getting Started with React
Getting Started with ReactGetting Started with React
Getting Started with React
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Proactive Responsive Design
Proactive Responsive DesignProactive Responsive Design
Proactive Responsive Design
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 
Red Dirt JS
Red Dirt JSRed Dirt JS
Red Dirt JS
 
Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC
 
DrupalCon jQuery
DrupalCon jQueryDrupalCon jQuery
DrupalCon jQuery
 
Think Vitamin CSS
Think Vitamin CSSThink Vitamin CSS
Think Vitamin CSS
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
Meet Clumsy
Meet ClumsyMeet Clumsy
Meet Clumsy
 
Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
Accelerated Grid Theming
Accelerated Grid ThemingAccelerated Grid Theming
Accelerated Grid Theming
 
Urban Leadership Slides
Urban Leadership SlidesUrban Leadership Slides
Urban Leadership Slides
 
Themes from Ascent of a Leader
Themes from Ascent of a LeaderThemes from Ascent of a Leader
Themes from Ascent of a Leader
 
7 Storey Mountain
7 Storey Mountain7 Storey Mountain
7 Storey Mountain
 
Marketing 450 Guest Lecture
Marketing 450 Guest LectureMarketing 450 Guest Lecture
Marketing 450 Guest Lecture
 
Fundamental Design Principles
Fundamental Design PrinciplesFundamental Design Principles
Fundamental Design Principles
 
Striking a Balance: Middle Ground in Front-End Development
Striking a Balance: Middle Ground in Front-End DevelopmentStriking a Balance: Middle Ground in Front-End Development
Striking a Balance: Middle Ground in Front-End Development
 
Echo Conference 2008
Echo Conference 2008Echo Conference 2008
Echo Conference 2008
 
Bible Tech 2008
Bible Tech 2008Bible Tech 2008
Bible Tech 2008
 

KĂŒrzlich hochgeladen

Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
home
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptx
suhanimunjal27
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
aroranaina404
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
tbatkhuu1
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
mirandajeremy200221
 
B. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdfB. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdf
University of Wisconsin-Milwaukee
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
SUHANI PANDEY
 

KĂŒrzlich hochgeladen (20)

Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance VVIP 🍎 SER...
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptx
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
 
B. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdfB. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdf
 
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funnel
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 

Rapid Templating with Serve

  • 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. I do mobile/web UX + JavaScript at (me, on Twitter: @nathansmith) http://projekt202.com
  • 3. Relax, don’t stress out taking notes. You can get the slides here
 http://j.mp/get-serve
  • 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.)
  • 5. Which isn’t to say we weren’t using CSS
 html body * div#id table tbody tr td a.special span { /* Dear next developer: Please forgive me! */ color: red !important; }
  • 6. 
but at least we had a reliable design workïŹ‚ow.
  • 8.
  • 9. Which of course, now looks like this

  • 10.
  • 11. And, can dynamically change into this

  • 12.
  • 13. The term “Responsive Web Design” was coined by Ethan Marcotte, in an an article published by A List Apart. Loosely deïŹned, it means adapting to various screen sizes, using a ïŹ‚uid grid and @media queries in CSS.
  • 14. Ethan also wrote a book
 http://abookapart.com/products/responsive-web-design
  • 15. Upon hearing about this new design technique, I
 1. Felt shock and denial: “Whoa, no way!” 2. Felt guilty for making a ïŹxed-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
  • 16. Yes, those are (very loosely interpreted) the various stages of grief. Essentially, responsive design has both obliterated, and breathed new life into, our ïŹeld.
  • 17.
  • 18. Like accessibility, RWD works best with advanced planning
 #FAIL
  • 19. Designers “throwing it over the wall” to developers is no longer an ideal workïŹ‚ow. Nowadays, all of the cool kids are working collaboratively. http://ïŹ‚ickr.com/photos/camknows/8374910613
  • 20. We’ve had to rethink our vantage point.
  • 21. Venerable tools like Photoshop still have their place, but other (equally important) front-end tools have arisen as well

  • 22.
  • 23.
  • 24. Neatly organized *.sass CSS served to browser http://thingsorganizedneatly.tumblr.com/post/9494864300/submission-the-compulsively-tidy-ursus-wehrli
  • 25. CSS Sass Compass http://sonspring.com/journal/sass-for-designers
  • 26. Compass makes vendor preïŹxes easy...
  • 27. Compass brings sanity to gradients...
  • 28. Text editors and IDE’s that support Sass/SCSS syntax Aptana BBEdit Chocolat Coda http://aptana.org http://barebones.com/bbedit http://chocolatapp.com http://panic.com/coda E Text Editor Eclipse Emacs Espresso http://e-texteditor.com http://eclipse.org http://gnu.org/software/emacs http://macrabbit.com/espresso GEdit Komodo Netbeans PhpStorm http://projects.gnome.org/gedit http://activestate.com/komodo-ide http://netbeans.org http://jetbrains.com/phpstorm PyCharm RubyMine SubEthaEdit Sublime Text ^ http://jetbrains.com/pycharm http://jetbrains.com/ruby http://codingmonkeys.de/subethaedit http://sublimetext.com/dev TextMate Vim Visual Studio nd http://macromates.com http://vim.org http://microsoft.com/visualstudio We  recomme http://sass-lang.com/editors.html
  • 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
  • 30.
  • 31. Continuing the analogy, Serve is like
 http://hdwallpapers.in/the_avengers-wallpapers.html
  • 32. Since I can’t show you NDA’d client stuïŹ€ I’ve made using Serve, we are going to look at one of my personal projects. http://unsemantic.com
  • 33.
  • 34.
  • 35. I think of wireframes and prototypes like this
 http://blogs.pennmanor.net/hstsa/nasa/nasa-space-project
  • 36. Ultimately, what we’re aiming to launch is not a PSD ïŹle or PDF wireframe. Nor is it the ïŹ‚at HTML, CSS, and JavaScript that comprise a dynamic prototype. Everything except the ïŹnal product exists just to facilitate the launch. It’s chaïŹ€ that burns up, once the real thing takes ïŹ‚ight. To that end, Serve is like the V of Ruby on Rails’ MVC. It is similar to the “real thing.”
  • 37. This is the index.html.erb home page “view” ïŹle.
  • 38. _layout.html.erb points to application.html.erb This ïŹle has one code snippet
 <%= render :template => "/layouts/application" %>
  • 39. <%= yield %> outputs the view ïŹle (index, etc.)
  • 40. This ïŹle also renders the <head> partial.
  • 41. Which then renders the stylesheets partial.
  • 42. That has all sorts of interesting goodies.
  • 43. Next up, let’s look at the Sass variables partial

  • 44.
  • 45. Which is imported by the base grid ïŹle
 Okay, cool.
  • 46.
  • 47. Which is imported by the responsive partial
 Eh? Another @import?
  • 48.
  • 49. Which is ïŹnally imported by application.sass
 Seriously, what the?
  • 50.
  • 51. Bear with me. There’s a point to all of this. We’ll get to it. Dude, there’d better be.
  • 52.
  • 53. So, after all of that, we end up with a tightly compiled, single application.css ïŹle. Eh? What about all the @import statements? HTTP requests, fool. C’mon man!
  • 54.
  • 55. That’s the beauty of Sass. If you @import a *.sass (or *.scss) ïŹle, it becomes part of the single, compiled *.css ïŹle. Rage subsiding? Okay, good. Still, why all the @import daisy chaining? Glad you asked! :)
  • 56. ← The astute observers amongst you perhaps have noticed what looks like a big compost heap of compiled CSS ïŹles. Oh, you saw that? Well

  • 57. Most of those ïŹles aren’t used directly, but

  • 58. 
exist to show grid CSS, apart from the site.
  • 59. Those are also the ïŹ‚at CSS ïŹles on GitHub.
  • 60. This is why grid code is in separate partials

  • 61. Hat tip to Nicolas Gallagher for the idea!
  • 62. Yep. I can identify with that! :)
  • 63. Maybe I (don’t) know what I’m doing. Here’s an idea

  • 64. Simple view helper function, named “html”
  • 65. Variable set in
 /views/partials/_vars.html.erb
  • 66. Then, we do/don't end links with *.html
  • 67. Further evidence that I (probably don't) know what I'm doing

  • 68. A voodoo-magic Z shell (or Bash) recipe

  • 69. I hate repetitive typing, so I’ve aliased the export command — which also recursively creates a *.zip ïŹle — to
 unsemantic_site_html
  • 70. Being lazy, FTW
 Computer, do my bidding!
  • 71. That builds all the ïŹ‚at ïŹles, and a *.zip of it all

  • 72. DEMO TIME! :) Also, don’t forget you can download the slides here
 http://j.mp/get-serve