1.1.0 • Published 3 years ago

less2sass-mv v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

less2sass-mv

This is a fork from ekryski/less2sass.

Build Status

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 :-(

Installing

npm install -g less2sass-mv

Running

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 <path_to_less_file_or_directory> [options]

Options

-d, --directory: A directory to which output transformed files.

Node API

const less2sass = require('less2sass');

const scss = less2sass.convert('@myColor: #f938ab; .myClass { color: @myColor; }');
console.log(scss);
// scss -> $myColor: #f938ab; .myClass { color: $myColor; }'

Caveats

  • 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!

Contributing

Development

Install dependencies:

npm install

First write tests in test, then make your changes and check them:

npm test

Credits

Written by Eric Kryski, forked and maintained by Yoan Tournade.