Background:
The cause is this, usually work is online office, style is to use less to write, so, so I download down from the online less files can not be directly in their own local environment to run. One problem is that I'm going to compile the less file into a CSS file so I can use it in the file. By the way, then why don't I take it from the line. Through the front-end building tools to package the compiled CSS files, this has been compiled a good file, but I just want to take a small paragraph, to find and because it was compressed, find it inconvenient, only the following content. Two methods, 1, I installed less in the local. 2. Another way to download the Koala software to compile the less code.
One, install less to compile less files
Style.less
. Wrap { header { font-size: 12px; } {font-size: 12px; } }
Issues encountered in OSX installation:
The above is a little less code that I wrote. Install less according to the method of the lesscss.cn hint, the process is a command, but here I would like to say my OSX installation encountered problems.
A command: $ NPM install-g less (installed in a global environment)
But in OSX there may be a problem with insufficient permissions, the last second line of the error message.
NPM err! Please try running the This command again as Root/administrator.
Workaround: Under the OSX command line, install as an administrator, plus sudo.
Sodu $npm install-g Less can solve this problem.
After installing less, how do I use it?
LESSC style.less Style.css So the less is compiled into CSS.
Happy, my initial problem solved successfully, next time I will be able to take out from the online project that I want to the less code, after the local compilation into the file to use. But there is a small problem, whether I change every time, every time to go to the command line to compile less code, a little trouble. After a search, you can use the Koala software to implement monitoring less code changes and compile the file.
Second, download koala software to compile less code
Http://koala-app.com/index-zh.html
Encounter a pit, compile the folder name of the file can not be less, will lead to compile, I planted a pit.
And then just drag the file over, just fine.
Reference Links:
Http://www.w3cplus.com/blog/777.html
Local or Koala software compiles less file as CSS