sass - How to convert Less to Scss?

ID : 274510

viewed : 53

Tags : sasslesssass





Top 5 Answer for sass - How to convert Less to Scss?

vote vote

98

The less2sass converter is pretty good and maintained https://www.npmjs.com/package/less2sass

Install it (you need https://nodejs.org/en/ on your system)

npm install -g less2sass 

Once installed you can simply run

less2sass <path_to_less_file_or_directory> 
vote vote

84

this works okayish:

https://www.npmjs.com/package/less-scss-convertor

npm install -g less-scss-convertor less-scss-convertor src\less 

creates src\less\scss

vote vote

77

This online option seems to work well. Paste in an entire file to convert it.

https://less2scss.awk5.com

vote vote

67

The one that worked best for me is this: https://github.com/debba/less2scss

npm install less2scss --global less2scss -s ./less_folder  -d ./scss_folder -r -e 'node_modules,vendor'

I just tried it and it seems I don't have to change anything on the converted files. You can exclude folders, it works recursively and you can define a target folder. Love the functionality.

vote vote

54

You could try using parts of Bootstraps's converter to create your own: https://github.com/twbs/bootstrap-sass/blob/master/tasks/converter/less_conversion.rb

However in most cases there will always be some cleanup you need to do manually.

Top 3 video Explaining sass - How to convert Less to Scss?







Related QUESTION?