Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Less to Scss?

Tags:

sass

less

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?

like image 271
HalloTheme Avatar asked Oct 23 '14 06:10

HalloTheme


People also ask

What is difference between SCSS LESS?

SCSS and LESS are both "supersets" of vanilla CSS. That means valid CSS is automatically also valid SCSS and LESS, but not necessarily the other way around. The difference between SCSS and LESS is that they have a different syntax. They mostly have the same functionalities.

Why Sass is better than LESS?

SASS users can easily choose their syntaxes, and the developer can decide when to move away from CSS rules. On the other hand, LESS has an advantage in functions where users can activate mixins when certain conditions occur. SASS also provides loops and cases which programmers know.

Is sass the same as SCSS?

SASS (Syntactically Awesome Style Sheets) is a pre-processor scripting language that will be compiled or interpreted into CSS. SassScript is itself a scripting language whereas SCSS is the main syntax for the SASS which builds on top of the existing CSS syntax.

How do I convert a CSS file to LESS?

Click on the URL button, Enter URL and Submit. This tool supports loading the CSS File to transform to LESS. Click on the Upload button and select File. CSS to LESS Online works well on Windows, MAC, Linux, Chrome, Firefox, Edge, and Safari.


1 Answers

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>
like image 56
gagarine Avatar answered Oct 26 '22 20:10

gagarine