Как установить less в sublime text 3
Перейти к содержимому

Как установить less в sublime text 3

  • автор:

Name already in use

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Less syntax for Sublime Text 3

Provides syntax highlighting for .less (or .css.less ) files, with

  • snippets
  • completions
  • symbols

Highlights code using up to date specifications for properties and values to help you catch typos.

How to set up a LESS build in Sublime Text

Switching software while developing an app or website may be frustrating if you do small changes and test them. Why then not incorporate a LESS plugin for your environment? Actually, there’s a LESS-build package for Sublime Text, but it doesn’t work properly for the newest LESS syntax (i.e. for the Bootstrap files). How to overcome this issue?

Install LESS

========
This can be done using Node Packaged Modules. Go to your command line and type:
npm install -g less
Simple as that.

Install Sublime Text package

====================
Open Sublime Text, press Ctrl+Shift+P, select Package Control: Install Package. Then find Less2Css package and press enter.

You should now have this plugin installed. To use it, simply open your main .less file and resave it. A new file with the same name but with .css extension should appear in your LESS folder.

HTML/CSS/JS Prettify problems

If you use HTML/CSS/JS Prettify plugin, you may actually notice that your LESS files don’t compile properly. This is caused by the prettify-on-save option. To turn it off press Alt+Shift+H and then o. Change line:
»format_on_save»: true
to:
»format_on_save»: false

Как установить и настроить плагин для Sublime Text 3 less to css?

Помогите пожалуйста, устанавливаю данный плагин через Package Control сохраняю файл а он мне выдает ошибку в консоль:

Writing file /C/webservers/home/zabava.loc/www/assets/less/main.less with encoding UTF-8 (atomic)
[less2css] Converting C:\webservers\home\zabava.loc\www\assets\less\main.less to C:\webservers\home\zabava.loc\www\assets\css\main.css
error: less2css error: [WinError 2] Не удается найти указанный файл

  • Вопрос задан более трёх лет назад
  • 11572 просмотра
  • Facebook
  • Вконтакте
  • Twitter
  • Facebook
  • Вконтакте
  • Twitter

Да действительно не стоял компилятор, но даже после того как я его поставил компилирование не происходит. Мельком появляется консольWindows а в консоли Sublime ругается на кодировку:

[GUIDE] How to build LESS to CSS in SublimeText 3 on Windows

I wanted to share this little piece of information in hopes that it will prove useful to somebody. I've been looking for plugins and programs that would let me easily build my LESS code to CSS files, but all of the guides and programs I found were outdated. So I started looking into it myself and found out that it is surprisingly easy to get everything working!

This guide should work on all versions of Windows and all versions of Sublime Text.

Open up a command prompt as administrator and type in: npm install -g less

After that, if you want CSS minification support, type in: npm install -g less-plugin-clean-css

Open up SublimeText and go to Tools -> Build System -> New Build System

Edit the build system to suit your needs. Here are three different options. Just paste in the text and save the file as "LESS.sublime-build" to the default location it suggests.

Build .css and .min.css files

Build .min.css file only

Build .css file only

After that is done select Tools -> Build System -> LESS. You can now build your .less files in Sublime by pressing CTRL+B. This will generate CSS files of your choosing to the same folder as your .less file. It will overwrite any previous files with the same name.

If you ever want to edit the build system settings, you can find the file at \Sublime Text 3\Data\Packages\User\LESS.sublime-build

Bonus!

If you want LESS syntax highlighting too, do this:

Open SublimeText and go to Preferences -> Package Control

Choose "Package Control: Install Package"

Type in "LESS" and find the package that reads "LESS syntax highlighting"

After you've installed the package, go to View -> Syntax -> LESS

I'm not the creator of any of these software or plugins and all credit goes to the developers.

EDIT: This method is not meant to replace task runners. You should be using a task runner like Grunt if you're working with a larger projects. I just wrote this because I was intrigued and couldn't find a working plugin to do it. It's easy to setup and can save time when you need to compile a file only a couple of times. I didn't mean to offend you or the way you're used to work.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *