ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Libsass Build

by blitzrk ALL

Build system for Sass/scss files in Sublime Text 2/3 with no external dependencies

Labels sass, scss, css

Details

Installs

  • Total 12K
  • Win 8K
  • Mac 3K
  • Linux 1K
Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10
Windows 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
01234Mar 27Mar 24Mar 21Mar 18Mar 15Mar 12Mar 9Mar 6Mar 3Feb 28Feb 25Feb 22Feb 19Feb 16Feb 13Feb 10Mar 27 Linux: 0 Mac: 0 Windows: 0Mar 26 Linux: 0 Mac: 0 Windows: 0Mar 25 Linux: 0 Mac: 0 Windows: 1Mar 24 Linux: 1 Mac: 0 Windows: 0Mar 23 Linux: 0 Mac: 0 Windows: 0Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 1Mar 20 Linux: 0 Mac: 0 Windows: 0Mar 19 Linux: 0 Mac: 0 Windows: 0Mar 18 Linux: 0 Mac: 0 Windows: 0Mar 17 Linux: 0 Mac: 0 Windows: 0Mar 16 Linux: 0 Mac: 0 Windows: 0Mar 15 Linux: 0 Mac: 0 Windows: 0Mar 14 Linux: 0 Mac: 0 Windows: 0Mar 13 Linux: 0 Mac: 0 Windows: 0Mar 12 Linux: 0 Mac: 0 Windows: 0Mar 11 Linux: 0 Mac: 0 Windows: 1Mar 10 Linux: 0 Mac: 0 Windows: 1Mar 9 Linux: 0 Mac: 0 Windows: 0Mar 8 Linux: 0 Mac: 0 Windows: 0Mar 7 Linux: 0 Mac: 0 Windows: 1Mar 6 Linux: 0 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 0Mar 4 Linux: 0 Mac: 0 Windows: 0Mar 3 Linux: 0 Mac: 0 Windows: 1Mar 2 Linux: 0 Mac: 0 Windows: 0Mar 1 Linux: 0 Mac: 0 Windows: 0Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 0 Windows: 0Feb 26 Linux: 0 Mac: 0 Windows: 0Feb 25 Linux: 0 Mac: 0 Windows: 0Feb 24 Linux: 0 Mac: 1 Windows: 1Feb 23 Linux: 0 Mac: 0 Windows: 0Feb 22 Linux: 0 Mac: 0 Windows: 0Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 1Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 0 Windows: 1Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 0Feb 10 Linux: 0 Mac: 0 Windows: 1Mar 27 Linux: 0 Mac: 0 Windows: 0Mar 26 Linux: 0 Mac: 0 Windows: 0Mar 25 Linux: 0 Mac: 0 Windows: 1Mar 24 Linux: 1 Mac: 0 Windows: 0Mar 23 Linux: 0 Mac: 0 Windows: 0Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 1Mar 20 Linux: 0 Mac: 0 Windows: 0Mar 19 Linux: 0 Mac: 0 Windows: 0Mar 18 Linux: 0 Mac: 0 Windows: 0Mar 17 Linux: 0 Mac: 0 Windows: 0Mar 16 Linux: 0 Mac: 0 Windows: 0Mar 15 Linux: 0 Mac: 0 Windows: 0Mar 14 Linux: 0 Mac: 0 Windows: 0Mar 13 Linux: 0 Mac: 0 Windows: 0Mar 12 Linux: 0 Mac: 0 Windows: 0Mar 11 Linux: 0 Mac: 0 Windows: 1Mar 10 Linux: 0 Mac: 0 Windows: 1Mar 9 Linux: 0 Mac: 0 Windows: 0Mar 8 Linux: 0 Mac: 0 Windows: 0Mar 7 Linux: 0 Mac: 0 Windows: 1Mar 6 Linux: 0 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 0Mar 4 Linux: 0 Mac: 0 Windows: 0Mar 3 Linux: 0 Mac: 0 Windows: 1Mar 2 Linux: 0 Mac: 0 Windows: 0Mar 1 Linux: 0 Mac: 0 Windows: 0Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 0 Windows: 0Feb 26 Linux: 0 Mac: 0 Windows: 0Feb 25 Linux: 0 Mac: 0 Windows: 0Feb 24 Linux: 0 Mac: 1 Windows: 1Feb 23 Linux: 0 Mac: 0 Windows: 0Feb 22 Linux: 0 Mac: 0 Windows: 0Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 1Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 0 Windows: 1Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 0Feb 10 Linux: 0 Mac: 0 Windows: 1Mar 27 Linux: 0 Mac: 0 Windows: 0Mar 26 Linux: 0 Mac: 0 Windows: 0Mar 25 Linux: 0 Mac: 0 Windows: 1Mar 24 Linux: 1 Mac: 0 Windows: 0Mar 23 Linux: 0 Mac: 0 Windows: 0Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 1Mar 20 Linux: 0 Mac: 0 Windows: 0Mar 19 Linux: 0 Mac: 0 Windows: 0Mar 18 Linux: 0 Mac: 0 Windows: 0Mar 17 Linux: 0 Mac: 0 Windows: 0Mar 16 Linux: 0 Mac: 0 Windows: 0Mar 15 Linux: 0 Mac: 0 Windows: 0Mar 14 Linux: 0 Mac: 0 Windows: 0Mar 13 Linux: 0 Mac: 0 Windows: 0Mar 12 Linux: 0 Mac: 0 Windows: 0Mar 11 Linux: 0 Mac: 0 Windows: 1Mar 10 Linux: 0 Mac: 0 Windows: 1Mar 9 Linux: 0 Mac: 0 Windows: 0Mar 8 Linux: 0 Mac: 0 Windows: 0Mar 7 Linux: 0 Mac: 0 Windows: 1Mar 6 Linux: 0 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 0Mar 4 Linux: 0 Mac: 0 Windows: 0Mar 3 Linux: 0 Mac: 0 Windows: 1Mar 2 Linux: 0 Mac: 0 Windows: 0Mar 1 Linux: 0 Mac: 0 Windows: 0Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 0 Windows: 0Feb 26 Linux: 0 Mac: 0 Windows: 0Feb 25 Linux: 0 Mac: 0 Windows: 0Feb 24 Linux: 0 Mac: 1 Windows: 1Feb 23 Linux: 0 Mac: 0 Windows: 0Feb 22 Linux: 0 Mac: 0 Windows: 0Feb 21 Linux: 0 Mac: 0 Windows: 0Feb 20 Linux: 0 Mac: 0 Windows: 0Feb 19 Linux: 0 Mac: 0 Windows: 1Feb 18 Linux: 0 Mac: 0 Windows: 0Feb 17 Linux: 0 Mac: 0 Windows: 0Feb 16 Linux: 0 Mac: 0 Windows: 0Feb 15 Linux: 0 Mac: 0 Windows: 0Feb 14 Linux: 0 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 0 Windows: 1Feb 12 Linux: 0 Mac: 0 Windows: 0Feb 11 Linux: 0 Mac: 0 Windows: 0Feb 10 Linux: 0 Mac: 0 Windows: 1

Readme

Source
raw.​githubusercontent.​com

Libsass version Sassc version

Libsass Build

Linux & OSX Windows
Build Status ?

Build system for Sass/scss files in Sublime Text 2/3 with no external dependencies

It uses libsass (via the official sassc front-end) for faster compile times compared to the official Ruby implementation.

https://github.com/blitzrk/sublime_libsass

Configuration

By default, sassc is given no arguments and css files are put in build/css relative to the assumed root of the project (the outermost parent directory containing a sass file from the file being compiled). The default output directory and sassc flags can be modified Preferences->Package Settings->Libsass Build ->Settings - User. There is a skeleton in Settings - Default or see below.

A project-specific configuration can written to .libsass.json file. Additionally, the location of this file will make explicit the root of the project as far as where sass imports and the output directory is based. You can edit this config or generate an example by selecting the menu item Tools->Libsass Build ->Edit Project Config.

Example:

You have the directory structure:

/path/to/projects/example/
|-- lib/
|-- static/
|   |-- js/
|   |-- css/
|   |   +-- main.css
|   +-- images/
|-- .libsass.json
+-- styles/
    |-- partials/
    |   +-- _reset.scss
    +-- main.scss (has @import 'partials/reset';)

Then you could use:

/path/to/projects/example/.libsass.json:

{
    "output": {
        "dir": "static/css",
        "structure": "flat"
    },
    "compile": {
        "line-comments": true,
        "line-numbers":  true,
        "style":         "nested", // Comments allowed in `.libsass.json`, but not `*.sublime-settings`
        "load-path":     "/path/to/projects/example/styles" // You DO NOT need this line
    }
}

or alternatively in /path/to/projects/example/styles/.libsass.json:

{
    "output": {
        "dir": "../static/css", // This path gets normalized, so `..`s get handled
        "structure": "flat"
    },
    "compile": {
        "line-comments": true,
        "line-numbers":  true,
        "style":         "nested",
        "load-path":     "/path/to/node_modules/bourbon" // Get your fill of bourbon or point to compass!
    }
}

Structure

In config you can specify in output.structure whether you want your compiled assets to be side-by-side or nested in their original structure.

./
|-- .libsass.json (output dir is "css")
|-- css/
+-- scss/
    |-- main.scss
    +-- modules/
        +-- menu.scss
  • nested (default): compiles to css/scss/main.css and css/scss/modules/window.css
  • nested with root directory: if your .libsass.json is further away, remove prefix to nested path
    • ex. “structure”: [“nested”, “scss”]
    • compiles to css/main.css and css/modules/menu.css
  • flat: compiles side-by-side to css/main.css and css/menu.css

Usage

Configuration is entirely optional, so in the simplest case, simply build with Ctrl+Shift+B. If you have another Sass build system installed, you may need to select Sass (libsass) in Sublime's menu.

Troubleshooting

Libsass isn't automatically chosen as the build system

If you have another Sass build system installed, it may be conflicting. If no build system is selected, then you may not have a Sass syntax definition installed or it may be oddly defined (i.e. not using source.sass or source.scss). Try replacing it with another syntax highlighting package such as Sass.

My file compiled, but I don't know where it went!

Libsass looks up the directory structure until it finds (or doesn't find) a .libsass.json config file. If you're not using a config file, then check that there isn't a config in any parent directory. E.g. if you have your project in /home/ben/projects/app and an extraneous config file /home/ben/projects/.libsass.json, the css will output relative to /home/ben/projects instead of to /home/ben/projects/app/build/css.

My configuration doesn't seem to do anything

In version 0.9.0 the configuration format was changed. Sorry about that, but it was important! And hopefully now the names are less confusing, too. Anyway, check out the examples above. The top-level keys are now “output” and “compile” instead of “output_dir” and “options”.

Invalid UTF-8

At the moment there are some bugs in Libsass Sublime's unicode support, so if you see a UTF error, you likely have a non-ascii character in the path or name of one of your files in your project. For now, the best workaround is to just rename your file or directory. This is obviously annoying and it will be fixed as soon as possible.