TigerMunky's Grrreat Trek

Leading banana slips and paw tracks along the digital highway...

  • Home
    • Edit
    • Delete
    • Tags
    • Autopost

    {less} is more...

    I came across this awesome tool today and thought I would share my experience with others...

    Less_is_more_1

     

     

    3 Steps to writing {less}

    1. Setup
    1.1 Install the less Ruby gem by opening up "Terminal" and typing in one line.

    (download)
    Click here to download:
    less-is-more-pguqFAFoxymjlHmGpJIv.zip (1.13 MB)

    1.2 Download the {less}.app.

    Less_is_more_1

     

     

    2. {less} App Usage

     2.1 Drag your css folder into the "Watched Folders" section.

    (download)
    Click here to download:
    less-is-more-yxitptxnafpFwfunBpgJ.zip (829 KB)

    2.2 Switch to the "Compiler" tab and turn on "Automatically compile files when saved".

    Less_compiler_3

    Coda Side-Note: There is a {less} plugin for Coda if ya don't mind first having to create a "Site" in your sites section first.

     

     

    3. {less} Usage
    3.1 Overview

    Basic workflow of {less}:
    1. Edit ".less" files.
    2. Save file -> as you save, the {less}.app automatically generates the ".css" file.
    Tip: If you have Growl, it will notify you when it has finished.
    3. Review your web page.
    My demo site is structured and looks like so:

    (download)
    Click here to download:
    less-is-more-gCvgDphFhbIDqsvFweeq.zip (591 KB)

    Tiger_munky_s_less_demo

     

    3.1 Import & Variables

    * You can start to create reusable CSS libraries by using the "@import" syntax.

    (download)
    Click here to download:
    less-is-more-AxjigAvdbutfDkhaIvoy.zip (129 KB)

    * Variables can be used to store CSS attribute values to be reused throughout your project so as to alleviate the trouble with core changes.

    (download)
    Click here to download:
    less-is-more-paigDkuEtaGqJGwApjdv.zip (27 KB)

     

    3.2 "Mixins"

    Yeah, it doesn't automatically mix sense just yet, but it's quite simple actually...

    I would like my ".panel" class to have rounded corners; so I'm going to "mix" or add the rounded corners styling by simply adding its CSS class name (".rounded-corners") to my ".panel" class:

    (download)
    Click here to download:
    less-is-more-yewJhpyllcnfvDiutcHD.zip (79 KB)

     

    3.3 "Nesting stuff"

    You can basically use this to nicely organize your CSS and type less ( excuse the pun ); I only have one item nested but imagine if you had more!...

    (download)
    Click here to download:
    less-is-more-uvyFHjysxDCCdjFkxiuI.zip (48 KB)

     

    3.4 Operations

    If you got a special magic formula, you can implement it with basic operations even if there is a unit of measurement (e.g. px, em, etc.).

     

    Operations_1

     

    All The Files

    • index.html - http://pastie.org/1010043
    • lib.css - http://pastie.org/1010045
    • MyStyle.less - http://pastie.org/1010049
    • MyStyle.css - You don't need this but here it is anyways: http://pastie.org/1010053
    • Hawaii_Killer.ttf - http://www.1001freefonts.com/HawaiiKiller.php


    Summary

    Tiger_munky_s_less_demo

    {less} is a pretty neat addition to any web designer/developers arsenal.

    I left out "Namespaces & Accessors" and a little more as I always believe that one should have at least one look at the official docs... you can find all the {less} techniques here: http://lesscss.org/docs.

    Hope this has helped you on your way to writing {less}; until next time, keep writing more, or {less}. :D

     

    TM

    Awesomeness lies in the hands of the brave.

    Tags » Awesomeness CSS Tool less app review ruby gem tutorial {less} {less} is more
    • 18 June 2010
    • Views
    • Permalink
    • Favorited 1 Times
    • Don Thorp
    • Tweet

    Comments 1 Comment

    Jun 19, 2010
    Don Thorp liked this post.

    Leave a Comment

  • Tiger Munky's Posterous

    Life, Innovation, Fun, Tech, Dev, Design, Recipes, Teaching,  and Sushi!

  • About Tiger Munky

    Life, Innovation, Fun, Tech, Dev, Design, Recipes, Teaching,  and Sushi!

  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
    You're a contributor here (Edit)
    This is your Space (Edit)
    Follow by email »
    Get the latest updates in your email box automatically.
  • Follow Me

      TwitterFacebookLaconi.ca/Identi.caPlurkJaikuFriendfeedPicasaFlickrVimeoYoutubeTumblrDeliciousBloggerLivejournalmetaweblogmetaweblog

Theme created for Posterous by Obox and tweaked by TigerMunky