Git Product home page Git Product logo

less-autocompile's Introduction

Sublime Text 3 LESS Autocompile

I do like this less-autocompile package for Atom. But I don't like Atom too much. I wanted that plugin for Sublime Text 3. So I've created my own very first plugin for ST3 inspired by @lohek

Warning! My plugin has not been tested well and I can't recommend you to use it till I finish it. I'll remove this warning once it is done. I've tested in on macOS only for now.

Dependencies

There is no magic, the plugin uses node's lessc to do the job. So it depends on some packages installed globally.

npm install -g less less-plugin-clean-css

Installation

I didn't add my plugin to Sublime Packages so there is only a manual way to install. But this is quite easy to do.

You need to download the plugin and put the folder LessAutocompile to Packages folder of your Sublime Text 3. The Packages folder can be found:

  • ~/Library/Application Support/Sublime Text 3/Packages (macOS)
  • ~/config/sublime-text-3/Packages/ (Linux) Note It can be different, depends on the way you've installed Sublime Text 3

Usage

Add the parameters on the first lines of the LESS file.

out (string):  path of CSS file to create
sourcemap (bool): create sourcemap file
compress (bool): compress CSS file
main (string): path to your main LESS file to be compiled

Example

less/styles.less

// out: ../css/styles.css
// sourcemap: true
// compress: true

@import "my/components/select.less";

less/my/components/select.less

// main: ../../styles.less

.select {
  height: 100px;
  width: 100px;
}

The plugin is being triggered every time .less file is saved.

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.