GithubHelp home page GithubHelp logo

sublime-less2css's Introduction

sublime-less2css

Sublime Text 2 and 3 Plugin to compile less files to css on save. Requires lessc installed on PATH.

Features

  • Automatically compile less -> css on save when editing a .less file in sublime
  • Reports compilation errors
  • Compile all less files in a directory to css files

NB This plugin requires lessc to be in your execution path

Important notes:

Installation

Install The Plugin

Either clone into your sublime packages directory, or just use Package Control

Install Requirements

Less2Css requires lessc to compile less to css.

Mac OS X / Linux(Ubuntu/Debian…)

  1. Install NodeJS (you may need nodejs-legacy - see issue #23)

  2. Install npm(NodeJS Package Manager)

  3. Install less

     npm install less -gd
    
  4. Optional: To use minification you will need a minifier. Install less-plugin-clean-css or similar.

     npm install -g less-plugin-clean-css
    
  5. Optional: To use autoprefix. Install less-plugin-autoprefix.

     npm install -g less-plugin-autoprefix
    

Windows

  1. Clone less.js-windows
  2. Add the path of your less.js-windows to PATH environment variable(How to?).

中文版详细安装教程

Configuration

less2css can be configured on two levels. There are the user settings which you can access through Preferences\Package Settings\less2css. These are your global settings. Below you will find a description for all the various settings. The second level where you can configure less2css is at the project level. If you have a Sublime Text project file, it has the extension .sublime-project, you can override your user settings for just that project. This will be described at the end of this chapter.

autoCompile

The allowed values are true and false. When this setting is set to true the plugin will compile your LESS file each time you save it (otherwise you can compile from Sublime's "Tools" > "Less > Css" > "Compile this file to css" menu item).

createCssSourceMaps

When true a css source map will be generated.

disableVerbose

This option allows for the disabling of the verbose option which is used by default. The only time you might want / need to turn this off is then using the ruby gem less (which does not support --verbose).

lessBaseDir

This folder is only used when compiling all LESS files at once through Tools \ Less>Css \ Compile all less in less base directory to css. This can be an absolute path or a relative path. A relative path is useful when your projects always use the same structure, like a folder named less to keep all your LESS files in. When compiling all files at once it will also process all subfolders under the base folder.

lesscCommand

This setting can be used to specify a different compiler. When it is left empty the default compiler, named lessc, will be used.

ignorePrefixedFiles

The allowed values are true and false. When this setting is true the plugin will not compile files whose file name start with an underscore (_) when:

  • saving and autoCompile set to true
  • building all LESS files through Tools \ Less>Css \ Compile all less in less base directory to css.

You can still compile the file through Tools \ Less>Css \ Compile this less file to css or the appropriate shortcut.

main_file

When you specify a main file only this file will get compiled when you save any LESS file. This is especially useful if you have one LESS file which imports all your other LESS files. Please note that this setting is only used when compiling a single LESS file and not when compiling all LESS files in the LESS base folder through Tools \ Less>Css \ Compile all less in less base directory to css. Note: If your main file imports other files, the other files must be in the same folder for less2css to automatically compile your main file when editing an imported file.

minify

Default: True The allowed values are true/false or a string which passes a minification option to lessc (e.g. --clean-css). When this setting is set to true the LESS compiler will be instructed to create a minified CSS file. The recommended less minifier is npm install -g less-plugin-clean-css which is a required dependancy when minify=true.

minName

When the minify setting is set to true the LESS compiler will add .min to the created minified version of the css files: default.less would be compiled to the minified default.min.css.

outputDir

Use this setting to specify the folder where the CSS files will be placed. The following values are supported:

  • Empty string or ./ Use an empty string or ./ to have the CSS file stored in the same folder as the LESS file.

  • Absolute path Specify an absolute path to the directory where the CSS file should be stored, eg. /home/user/projects/site/assets/css

  • Relative path Specify a partial path to the directory where the CSS should be stored, eg. ./css. This will store the CSS files in a folder CSS in the root of the project.

auto setting

If you set the outputDir to auto, the plugin will try to automatically determine the folder where the CSS should be compiled to. It works best when you compile a single css file that imports other CSS files. If you work with multiple CSS files within one project that get compiled seperately, consider using the shadow setting instead.

The auto setting recognizes the following project setups:

  • When your LESS files are stored directly in a folder called css\less (and not in any subfolders) the compiled CSS files will be placed in the css folder.

    [project]
        |- [css]
        |---- [less]
        |-------- site.less
    

Will result in the following after compilation:

	[project]
	    |- [css]
	    |---- [less]
	    |-------- site.less
	    |---- site.css
  • When your LESS files are stored in a folder called less and its parent folder has a subfolder named css the compiled CSS files will be placed in the css folder.

    [project]
        |- [css]
        |- [less]
        |---- site.less
    

Will result in the following after compilation:

	[project]
	    |- [css]
	    |---- site.css
	    |- [less]
	    |---- site.less
  • If neither of the two cases above have been met the CSS file will be stored in the same folder as the LESS file is in.

shadow setting

Use this setting to compile a complete less folder into a shadow css folder. It is expected your LESS files are stored in a folder named less. Within this folder you are free to create any number of subfolder to organise your LESS files. When you compile a single file or all files through the menu command, the string less will be replaced with css in the file path. For example, if you have this file structure:

[project]
    |- [less]
    |---- [global]
    |-------- global.less
    |---- [elements]
    |-------- header.less
    |---- site.less

It will generate the same structure, only with css as its root folder like:

[project]
    |- [css]
    |---- [global]
    |-------- global.css
    |---- [elements]
    |-------- header.css
    |---- site.css
    |- [less]
    |---- [global]
    |-------- global.less
    |---- [elements]
    |-------- header.less
    |---- site.less

outputFile

When you specify an output file, this will be the file name used to compile all LESS files to. The content of the file will be overwritten after each compile. When you build all LESS file in the LESS base folder through Tools \ Less>Css \ Compile all less in less base directory to css you will only have the CSS of the last compiled file! Assign an empty string to have each LESS file compiled to its CSS counterpart, ie: site.less will become site.css.

showErrorWithWindow

Set to true to see parse errors in a pop up window

autoprefix

Set to true to add prefixes to css after conversion from less

silent

Set to true to stop any warnings from being shown.

Project settings

You can use the configuration settings that are described above and apply them to just the project you are working on. In order to do this you need to manually alter the .sublime-project file. A default project file looks like this:

{
	"folders":
	[
		{
			"path": "<path_to_project_folder"
		}
	]
}

You can add the less2css settings like this:

{
	"folders":
	[
		{
			"path": "<path_to_project_folder"
		}
	],
	"settings":
	{
		"less2css":
		{
			"autoCompile": false,
			"minify": false
		}
	}
}

Now the user settings autoCompile and minify will be overriden by the project setting.

sublime-less2css's People

Contributors

anothergituser avatar austinstudio avatar colmhally avatar eh1160 avatar gborelli avatar holyzfy avatar johanfriis avatar larvata avatar maciekbaron avatar mrswitch avatar n1k0 avatar nickwoodhams avatar oklai avatar pascaliske avatar pash7ka avatar playm avatar quanru avatar tbusser avatar tbusser-itouch avatar timdouglas avatar white-wolf avatar williamledoux avatar xusheng5 avatar xushengs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-less2css's Issues

Append CSS Output Name

I am working on a large site and have several LESS files. They are named styles.less, styles-custom.less... etc. When I put them into my production/dev sever I want them to be named styles.min.css and styles-custom.min.less and so on. Is there a way I can accomplish this with less2css? It seems like I have only two options, 1) rename the files after each time I save the file or 2) rename my LESS files (which would cause me to modify a ton of HTMLs and notify a bunch of people who use the files that the naming has changed.

Is there any way that I can append to the name of the CSS that is compiled? It seems like most sites do a similar thing with their final CSS (adding the .min to the name when it goes out to a further environment).

Thank you.

OutoputDir in Linux

Hi! im working on Ubuntu 12.10 and the plugin works great but the outputDir setting is weird.
my settings:
{
"lessBaseDir": "./",
"outputDir": "",
"minify": true, "autoCompile": true,
"showErrorWithWindow": true,
"main_file": "style.less"
}

the *.css is saved in /home/matias/py/project/static/less and i want to save it in /home/py/project/static/css. How i can do that? i tried with "../css" "./css" "./../css" and even with the full path, but still dosnt work ok.

Thanks!

Never installed through package manager

Hi Guys,

The plugin works like charm however It never gets installed through Package Manager, I have to manually create a folder on packages and drop the files.

Thanks

Ruben

----[less2cc] Compile Error----

Writing file /Users/Skyline0705/Desktop/untitled.less with encoding UTF-8
[less2css] Converting /Users/Skyline0705/Desktop/untitled.less to ./untitled.css
----[less2cc] Compile Error----
Error: EACCES, permission denied '/untitled.css'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at /usr/local/lib/node_modules/less/bin/lessc:160:24
at Object.Parser.parser.parse (/usr/local/lib/node_modules/less/lib/less/parser.js:476:17)
at parseLessFile (/usr/local/lib/node_modules/less/bin/lessc:147:8)
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)

but when i use "lessc -x ./untitled.less > ./untitled.css",it works

Document the settings

Could you please the document the settings? Right now it is not really clear what they do. I am trying to configure it do to one of the following:

  1. Place the compiled CSS file in the same folder as the LESS file
  2. Place the compiled CSS in a different root folder but follow the same folder structure as the folder with the LESS file.

Minify doesn't work on Win XP

I use Win XP (at work 😓).

So I've cloned the latest version of less.js-windows repo.
I set "minify": true in Less2CSS user settings.

The compilation works but it doesn't minify.

here my test.less file

// This is a test

.hello1 {
    color: red;
}

.hello2 {
    color: blue;
}

here is the compilation reult test.css :

.hello1 {
  color: red;
}
.hello2 {
  color: blue;
}

I was expecting someting like that :

.hello1 {color: red;}
.hello2 {color: blue;}

LESS 1.5 with source-map generator

Less 1.5 now allows to generate source map. Source map is easy to request by using parameters for lessc compiler such as --source-map[=FILENAME] But how to generate source map when we use less2css?

/usr/bin/env - error - linux

Hello

mu Xubuntu 12.04 produces this error:
Writing file /home/jm/TMP/less/test.less with encoding UTF-8
[less2css] Converting /home/jm/TMP/less/test.less to /home/jm/TMP/less/test.css
----[less2cc] Compile Error----
/usr/bin/env: node: No such file or directory

but the env file exists. I have tried to run the sublime as root with the same result.

main_file: option to have more than one main file.

i know, it sounds stupid, but shouldn't there a possibility to set more than one main-file?

think of the following scenarios:

a) one desktop.less and one mobile.less file
b) one landing-page.less and one app.less file
c) one modern-browsers.less and one ie.less file

i know, this is kind of an performance issue. but, when currently defining one main file, i'm not able to change an other "main file".

yes/no/maybe in the future?

error: less2css error: `lessc` is not available

Writing file /Users/sumomofukeqiao/Kelvin_app/Work/Pureit/html/static/css/test.less with encoding UTF-8 (atomic)
[less2css] Converting /Users/sumomofukeqiao/Kelvin_app/Work/Pureit/html/static/css/test.less to /Users/sumomofukeqiao/Kelvin_app/Work/Pureit/html/static/css/test.css
error: less2css error: lessc is not available
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
return self.run(edit)
File "less2css in /Users/sumomofukeqiao/Library/Application Support/Sublime Text 3/Installed Packages/Less2Css.sublime-package", line 46, in run
File "less2css in /Users/sumomofukeqiao/Library/Application Support/Sublime Text 3/Installed Packages/Less2Css.sublime-package", line 14, in init
File "less2css in /Users/sumomofukeqiao/Library/Application Support/Sublime Text 3/Installed Packages/Less2Css.sublime-package", line 21, in show
File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 866, in get
return sublime_api.settings_get_default(self.settings_id, key, default)
TypeError: Value required

My sublime text 3 install less2css, but when I save .less files always alert.
"less2css error: lessc is not available".

I install nodejs and less.
image

Outputting to root folder

Suddenly I notice that Less2Css is outputting to the project root folder rather than the location of the .less file. Here are my settings on OS X:

{
"lesscCommand": false,
"lessBaseDir": "./",
"outputDir": "./",
"outputFile": "", //[example.css] if left blank uses same name of .less file
"minify": true,
"autoCompile": true,
"showErrorWithWindow": false,
"main_file": false
}

I can't think of what the correct setting for outputDir would be to achieve the behavior I'm seeking. How might I reference the less file's location?

doesn't save *.css / ubuntu

hello

I try and try but still with no luck.
here is my setup:
{ "lessBaseDir": "/var/www/project/wp-content/themes/project_0.1", "minify": true, "outputDir": "/var/www/project/wp-content/themes/project_0.1" }

the output:
Writing file /var/www/project/wp-content/themes/project_0.1/style.less with encoding UTF-8 [less2css] Converting /var/www/project/wp-content/themes/project_0.1/style.less to /var/www/project/wp-content/themes/project_0.1/style.css [less2css] Convert completed!

but no css has been created :/

Less2css not working in windows

I already done with this step :
1 Install node.js
2 Install Less with npm install -g less
3 Install Less2css package

And then set my configuration in :
Preferences > Package Settings > Less2css > Settings - User
{
"lesscCommand": true,
"outputDir": "auto",
"outputFile": "",
"minify": true,
"autoCompile": true,
"showErrorWithWindow": false
}

And then.. when i tried save my .less file, the compiler not working..

[less2css] Converting C:\xampp\htdocs\jsapi\assets\xx\less\style.less to C:\xampp\htdocs\jsapi\assets\xx\css\style.css
Traceback (most recent call last):
File ".\sublime_plugin.py", line 362, in run_
File ".\less2css.py", line 40, in run
File ".\lesscompiler.py", line 89, in convertOne
File ".\lesscompiler.py", line 213, in convertLess2Css
File ".\subprocess.py", line 633, in init
File ".\subprocess.py", line 801, in _execute_child
File ".\subprocess.py", line 541, in list2cmdline
TypeError: argument of type 'bool' is not iterable

Is there step that i wrong? if i try using cmd and type "lessc C:\xampp\htdocs\jsapi\assets\xx\less\style.less C:\xampp\htdocs\jsapi\assets\xx\css\style.css" it working.

Css output for main less file only

When working with a .less project with multiple files I need compiling of one (main) .less file only. I have editted the code to make this possible. If you want I can show it to you but I don't know how to show it.

Since last update is not working

Hi, since the last update I can't make it work, I set less and stylsheet directory, of course I have installed lesscr on ubuntu, but isn't compiling anything on save.

less2css error: `lessc` is not avavailable

  1. I can run lessc from my terminal. Do you have any idea why it is not available in sublime?

  2. your error message has typo errors (should be available–not avavailable)

how to uninstall Less2css?

I took off the file from "packages" file, and no problem. But when I restarted the machine next day "Less2Css" file was back there. Any metod from package control?

Cheers
Rosa

"main_file" issue: not compile css from subfolder

I have following tree folders:
(components)
-----header.less
-----footer.less
-----content.less
main.less
i.sublime-projeect

I set "main_file": "main.less" in sublime project file.
When i try compile any less file from componets folder. main.less doesn't compile.

I put files from components in the same folder main.less and try compile footer.less, main.less compiles too.

Relative path

Hi,

In Windows 7 I set

"outputDir": "../css"

and it save file to

"outputDir": "../css/less"

How can i change the settings for compile less files to only outputDir without "/less" adding?
Thank you.

"main_file" issue: not compile css

When i setting it as:
{
"autoCompile": true,
"outputDir": "auto",
"main_file": true
}
the less2css would not compile css.
I have noticed if i change the {"main_file": false}, the less2css would work.
But i really want to use the "main_file"as "true", as i have one LESS file which imports all my other LESS files.
Could you please help me for that?

less2css stop working all of sudden for ST2 on a Mac

So I installed less2css for sublime text 2 on my mac 2 or 3 days a go and everything was great until last night it stopped working it doesn't show me any errors or message prompt nothing it just stop working. Please help

Convert completed, yet not css file when trying to compile a less file

I can't appear to create a css file with less2css anymore I get the following in the console:

[less2css] Converting /Users/username/Documents/sites/sitename/public_html/less/custom/main.less to ./main.css
[less2css] Convert completed!

It appears to work fine (according to the console), yet the new file doesn't exist?

Any ideas?

UnicodeDecodeError

Not used less2css for a while, but when I try saving a .less file I keep getting this error. I've updated the package, less and nodejs.

Writing file    /Users/lain/Documents/.../www/content/themes/elverumsregionen/assets/css/app.less with encoding UTF-8
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./less2css.py", line 45, in run
  File "./lesscompiler.py", line 75, in convertOne
  File "./lesscompiler.py", line 285, in parseBaseDirs
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 33: ordinal not in range(128)`

Any thoughts on what's wrong?

showErrorWithWindow true by default

I would suggest setting showErrorWithWindow to true in the default settings as I've just spent 15 minutes trying to work out why my LESS wasn't compiling (variable typo).

There was no output into the console to suggest anything was wrong. A popup would have saved my time!

Output Path on Mac

Whenever compiling the Less file it's default output path is very root of my hard drive, shouldn't this be the root of the project/folder?

Or am I missing something?

It does not compile on Windows 7

Hi.
im getting this error

 Traceback (most recent call last):
     File ".\sublime_plugin.py", line 362, in run_
     File ".\less2css.py", line 87, in run
     File ".\less2css.py", line 25, in convertOne
IndexError: list index out of range

Already try console command and works; i used this:

 lessc input.less output.css -x --verbose

Not sure what im doing wrong, The oddest thing was that work a couple of times and it stopped working. Tnks
By the way, Nice plug in :)

.sublime-project configuration not working

Hi there,
seems i can't override the default settings with projects specific which in my case are:

"settings":
{
"less2css":
{
"autoCompile": true,
"ignorePrefixedFiles": false,
"lessBaseDir": "./less",
"lesscCommand": false,
"main_file": "bootstrap.less",
"minify": true,
"outputDir": "./css/libs",
"outputFile": "bootstrap3.css",
"showErrorWithWindow": true
}
}

Thanks for the help ( and the plug in :) !

Can't set base css directory

Hi,

I've tried to modify the default folder for the css directory, but I can't make it work, I get an alert saying "Entered directory does not exist" and the css file is created inside my less directory.
My site structure is like this:

[root]
> [assets]
> >[less]
> >[css]

I've also try to modify the default setting of less2css.sublime-settings from "./css" to "./assets/css" and other combinations but it doesn't work. Any ideas ??

Message when less compile fails

Is it possible to have a window or alert popup when less compiling fails? Right now, it just does not built the .css file, but no message is shown.

Thanks.

upload outputFile on save

Hello,

First of all, thanks for this amazing plugin. It works perfectly, it compile my .less file to a .min.css file, but since I have upload_on_save defined to "true", it upload my .less file to the server.
Is there a way to send the output file to the server as well on save ?

Thanks!

Sublime3 - doesn't save css

Heloo

does the less2css work in sublime 3?
In my case it doesn't. (Ubuntu 13.04)
(no errors in console)
thanks

Allow output dir to be relative to less file being compiled

Originally asked by @BrunoDeleo in issue #20:

"is there a way to set the css outputdir relative to the less file being saved instead of being relative to the project folder? This would be great since I really don't use sublime projects, it would be too tedious given my workflow."

Created a new issue to make it easier to track...

less2css error: [Errno 2] No such file or directory

Hi,
I am having problem with less2css on my Mac OS 10.7.

I have installed less2css on sublime 2. but for no reason its giving me following error.

"less2css error: [Errno 2] No such file or directory"

I tried to debug the code and I came to following conclusion
code is failing at
"p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)" in "convertLess2Css" in "lesscompiler.py"

First I thought It is coming because of encoding issue for file paths , so I fixed the path with encoding them with "utf-8". But still it shows up.
I also tried the same command from command line and it worked perfectly no error nothing it executed perfectly.
So Right now I am clueless about it , could you help me out in this issue.

Exception that I got is

error: less2css error: [Errno 2] No such file or directory
Traceback (most recent call last):
File "./sublime_plugin.py", line 362, in run_
File "./less2css.py", line 39, in run
MessageWindow(resp)
File "./less2css.py", line 14, in init
self.show(message)
File "./less2css.py", line 27, in show
sublime.error_message(message)
Boost.Python.ArgumentError: Python argument types in
sublime.error_message(NoneType)
did not match C++ signature:
error_message(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >)

Thanks!

feature: extra output settings

I miss the following features:

  • Ability to set path to assets - for example in my project css and less directories are under /Assets dir, so I can't use "relative", "shadow" or "auto", because they will always look for project root. If I use absolute path, I will miss the nesting. probably a "assets_prefix" in the settings which by default will be empty string, but if populated it will be appended to project root it will be enough.
  • Ability to convert nested to flat - for example: if I have nested less directory and I want to outpyt all files in single directory. The problem is that while I can use same file names under different directories, the files will be overwriten in the outputDir if I use relative or absolute path. The solution could be to add a setting which make output name combination of relative path and filename.

For example:

/less/module/style.css
less/style.css

This could be stored in the output as:

/css/module-style.css
/css/style

Of course this probably require another settings "separator" which you can specify what will separate paths.

While the second is quite marginal, I believe that the first feature is quite nice to have.

main_file setting not working

My Main-File doesn't compile either.
My Settings (inside .sublime-project):

"less2css":
{
"lessBaseDir": "wp-content/themes/beste-medizin/library/less",
"outputDir": "wp-content/themes/beste-medizin/library/css",
"main_file": "style.less",
"minify": true,
"autoCompile": true,
"ignorePrefixedFiles": true,
"showErrorWithWindow": true
}

when i hit save while editing _base.less, style.less doesn't get compiled to style.css.
My File Structure:

less/_base.less
less/_mixins.less
less/_1030up.less
less/style.less

css/style.css

Thanks for your help

A Folder name which contain "less" (e.g. myprojectless), is confusing the CSS destination.

Was working on a project, and in the middle of the folder name has the word "less".
This is confusing the output of the CSS file in the compiler.

I managed to fix by modifying the re.sub () so that it matches the entire word "less" only:

...
line 162: dirs['css'] = re.sub('less', 'css', os.path.dirname(less))
- TO: dirs['css'] = re.sub(r'\bless\b', 'css', os.path.dirname(less))
...
...
line 284: output_dir = re.sub('less', 'css', file_dir)
- TO: output_dir = re.sub(r'\bless\b', 'css', file_dir)
...

Conflict with SublimeCodeIntel

Hello,
After installing less2css I noticed that SublimeCodeIntel stoped working with an import error:
"ImportError: cannot import name ast" in a SublimeCodeintel module (pythoncile1.py)

I looked at the module (pythoncile1.py) and noticed it imports the standard library module "compiler"

Since codeintel worked until i installed less2css i surmised that there was a conflict, so I looked at less2css and noticed that less2css includes a compiler.py module which it imports.

Renaming compiler.py to l2ccompiler, and changing the import statement (less2css.py line 4) from "import compiler" to "import l2ccompiler as compiler" fixed the issue.

Platform:
Sublime Text 2 v 2.01 build 2217
Ubuntu 12.04
Python 2.7

outputDir not properly set when minify set to false

I think I may have found a small bug where the outputDir is not correctly set for some reason when the minify setting is set to false. I spent a good few minutes trying to figure out why the output kept going to the less folder no matter what I set as the outputDir path.

My dir structure is as follows:

assets
|
--------------- css
|
--------------- less

and it would always append assets/less to whatever value I had for the outputDir. Example if I had "outputDir": "../css"

The css file would be saved in css/assets/less/foo.css

I eventually decided to try removing the other settings (minify, autocompile, etc) one by one to see if that made a difference and when i removed the minify setting, the css files were being correctly saved to the css folder.

Still with problems setting source/output folders between projects

Hi,

I use sublime with multiple projects, so when I switch between projects (some have diffrent paths or folder structures) I have to set manually the new source and output folders for the plugin to work again. I'm using it on Ubuntu by the way.

Everytime is more frustrating due the plugin doesn't seem to save those folders correctly. Sometimes if I change the default setting via the menu of the plugin it gave me the error 'Folder not exist' or if it works then the output file is the source file (so the css files is exported inside the less directory)...So i'm forced to change the paths manually via the 'less2css-sublime-settings' file, and again, sometimes it works and sometimes it doesn't.

So, my question is: how can I set paths in a consistent way so I'm sure it will always work? What is the right syntax to get the directories I need, even if I have to change between projects.?

Bellow I paste a typical example of diffrents paths I have to switch daily between projects

/home/rodrigo/htdocs/wordpress/wp-content/themes/sometheme/library/less/

/home/rodrigo/htdocs/somesite/less/

Thank you !

Install LESSC in windows.

Hello, I am having some troubles to compile .less with your plugin because I do not have lessc installed in Windows. The plugin fails on the line 34, trying to execute the lessc command.

Console log this:

Traceback (most recent call last):
File ".\sublime_plugin.py", line 362, in run_
File ".\less2css.py", line 82, in run
File ".\less2css.py", line 34, in convertOne
File ".\subprocess.py", line 633, in init
File ".\subprocess.py", line 842, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

Hope you could told me how to install lessc. Thank you for this great package

lessc command flags

Hey there,
Is there an option to specify command flags on the lessc command? I tried by modifying the lesscCommand parameter, but that seems to be for something completely different.
What I'm trying to do, specifically, is enable Source Mapping in Chrome with lessc --linenumbers=mediaquery [src] [output] as explained in this post, but I'm sure there are other flags that would be helpful to others, as well.

Also, thanks for the awesome plugin!

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.