How to convert Less to Scss?

巧了我就是萌 提交于 2019-12-03 13:12:19

问题


I have to use a converter, but it is very limited.

http://hallotheme.com/less2scss

Any idea how to convert from LESS to SCSS better?


回答1:


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>



回答2:


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




回答3:


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

https://less2scss.awk5.com




回答4:


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.



来源:https://stackoverflow.com/questions/26522554/how-to-convert-less-to-scss

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!