Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of saving automatic compilation for Sublime Text3 configuration less

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the method of saving automatic compilation of Sublime Text3 configuration less for you. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Under the Mac OSX environment

1.Sublime Text3 needs to install less, syntax highlighting plug-in

2.Install NodeJS, globally install less npm install less-gd on the mac terminal through npm

3.Optional: To use minification you will need a minifier. Install less-plugin-clean-css or similar.

Npm install-g less-plugin-clean-css

4.Optional: To use autoprefix. Install less-plugin-autoprefix.

Npm install-g less-plugin-autoprefix

At this point, you can compile the less file manually

Manually compile lessc style.less style.css through lessc at the Mac terminal

If you need to automatically compile to css when you need to save a less file in Sublime Text3, you also need the following steps

5.Sublime Text3 needs to install less2css to compile less into a plug-in for css

At this point, according to many official or online articles, it has been done.

But when I save the less file, I report a less2css error: lessc is not available error. It is obvious that it is possible to lessc manually at the terminal. What is the problem?

According to the error message, the lessc cannot be found, so continue to check the readme documentation that came with the less2css plug-in in sublime.

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

It may be the problem of environment variables. In general, it will match automatically when you install less2css.

The following needs to be done:

Type which lessc in the mac terminal and find the path to lessc / Users/ [username] / .nvm / versions/node/v10.10.0/bin/lessc

Modify the configuration file less2css.sublime-settings-User of less2css in Sublime Text3

{"lesscCommand": "/ Users/ [username] / .nvm / versions/node/v10.10.0/bin/lessc"}

At this point, you will find that when you save the less file in sublime Text3, a .css file with the same name appears under the current folder.

On "Sublime Text3 configuration less save automatic compilation method" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report