A quick less to sass converter
npm install less2sass-mvThis is a fork from ekryski/less2sass.

A little script to convert less to Sass files.
> Note: Due to the nature of less and sass it does not do a completely perfect conversion. You will have to do some manual work :-(
npm install -g less2sass-mv
You can run less2sass on a single file or on entire directory. It will recurse through the directory and convert any less files to Scss, preserving the directory structure.
less2sass-mv
-d, --directory: A directory to which output transformed files.
``
const less2sass = require('less2sass');
const scss = less2sass.convert('@myColor: #f938ab; .myClass { color: @myColor; }');
console.log(scss);
// scss -> $myColor: #f938ab; .myClass { color: $myColor; }'
`
- This does not really convert color functions, it makes a best attempt but most color functions will need to be ported over manually
- It does not convert to proper .sass yet. Only to .scss. (But you can use sass-convert to then convert to .sass)
- It may be buggy so you have to check your code but hopefully this script will save you some time. If you come across a bug, please create an issue. Better yet, a pull request!
Install dependencies:
`sh`
npm install
First write tests in test, then make your changes and check them:
`sh``
npm test
Written by Eric Kryski, forked and maintained by Yoan Tournade.