使用yaml編譯scss

安裝scss_tool

sudo easy_install -U distribute
sudo pip install scss_tools

style.scss:

$width:1308px
$leftWidth:200px
#content {                                                                                                                                                                   
    width: 1308px;

    .left {
        float: left;
        width:$leftWidth;    
    }   
    .right {
        float: left;
        width:$width-$leftWidth;
    }   

}

配置scss.yaml:

---

monitor:
    # path to Scss directory for monitoring
    scss_dir:
        scss

compiler:
    # verbosity of message output
    verbosity: 2

    # compress
    compress: True

    # debug info
    debug_info: False

    # root of static files
    static_root:
        static

    # directory to output sprite images
    asset_root:
        static/asset

    # paths to import
    load_paths: [
        static/scss
    ]

    # path of input files and path of file to output
    scss_files: [
        [scss/style.scss, static/style.css],
    ]

...

將scss編譯成css:

scss_monitor -c scss.yaml