Giter Club home page Giter Club logo

sass-build-sublimetext2's Introduction

Sass build system for Sublime Text

Description

This is a plugin for Sublime Text 2/3 providing four build systems for Sass/SCSS files:

  • Nested (default)
  • Compressed
  • Compact
  • Expanded

Prerequisites

Requires Ruby & Sass libraries.

####Step-by-step library installation guide:

  1. Install Ruby library

    Windows: Download and install Ruby. You can find it here: http://rubyinstaller.org/downloads/

    Reboot after installing it.

    IMPORTANT: Don't forget to mark the option 'Add Ruby executables to your PATH'. If you don't check this option, you will have to modify the path in the Build file afterwards.

    OS X & Linux: It's already installed. Easy! :)

  2. Installing Sass

    Open your console (Command prompt with Ruby on Windows or Terminal on Mac) and execute the following command:

    gem install sass

    Depending on your user permissions, the above command may not work. If that is the case, try executing this command:

    sudo gem install sass

Installing

OPTION 1 - With the Package Control plugin (recommended)

The easiest way to install this package is through Package Control.

  1. Download and install the Package Control Plugin. Follow the instructions on the website.

  2. Open the command panel: Control+Shift+P (Linux/Windows) or Command+Shift+P (OS X) and select 'Package Control: Install Package'.

  3. When the packages list appears type 'Sass' and you'll find the Sass Build System. Select to install it.

  4. Now you can compile your Sass files! Launch your build with Control+B (Linux/Windows) or Command+B (OS X).

  5. Enjoy your coding =)

OPTION 2 - With Git

Clone the repository in your Sublime Text "Packages" directory:

git clone git://github.com/jaumefontal/Sass-Build-SublimeText2.git Sass-build

Depending on your version of Sublime Text, you can find your 'Packages' inside the following directories:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/ ~/Library/Application Support/Sublime Text 3/Packages/
  • Windows: %APPDATA%/Sublime Text 2/Packages/ %APPDATA%/Sublime Text 3/Packages/
  • Linux: ~/.Sublime Text 2/Packages/ ~/.Sublime Text 3/Packages/

OPTION 3 - Without Git

Download the latest source zip from Github and extract it into a new folder named Sass-Build in your Sublime Text "Packages" folder.

Using the build

After installing the package you will find four new options in Tools > Build system option in your Sublime menu: Sass — Nested, Sass - Compressed, Sass — Expanded, and Sass - Compact.

By default, your .scss and .sass files will be built using the Sass — Nested setting. Additionally, the files will be saved into the same directory as the Sass file. For information on how to change this setting, please see the Recommendations section below.

And remember, always you can launch the selected build with Control+B (Linux/Windows) or Command+B (OS X).

Recommendations

####Changing the default folder for generated CSS

If you want to change the default folder of where your CSS is generated, you can edit the .sublime-build files, found in the Sass-build folder of the 'Packages' directory. In Sublime Text 3, you can easily access this directory through the Preferences > Browse Packages option in the Sublime menu:

Example: Save your CSS files into a css folder: "cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css"],

If you are using partials and running into issues, David Kiv suggests putting this code in the .sublime-build files:

Windows * "cmd": ["sass", "--update", "${project_path}\\scss\\styles.scss:${project_path}\\css\\styles.css", "--stop-on-error", "--no-cache"],

Mac * "cmd": ["sass", "--update", "${project_path}/scss/styles.scss:${project_path}/css/styles.css", "--stop-on-error", "--no-cache"],

Author

Created by Jaume Fontal (@jaumefontal).

If you need more info you can find me on Twitter!

Acknowledgments

Thanks to the collaboration of @hdennison with the testing in MacOS.

sass-build-sublimetext2's People

Contributors

jaumefontal avatar deadark avatar alexlitel avatar katiek2 avatar winfried-van-loon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.