简体   繁体   中英

how do i convert hundreds of CSS file to SCSS files?

I have existing project which is being used 300 css files and now the requirement is to convert it from css to SCSS.

Requesting your help on this, if some one shed some light it will be great full..

Online Tools

i have tried converting through online but it will lag too many hours to do, so finding some good idea / suggestion which can be done with script.

Thanks !!

You could use sass-convert from the sass gem :

sass-convert -R my_css_dir --from css --to scss

To convert every .css file inside my_css_dir

Note: It seems that you need sass 3.4.22. See here and there .

Ruby gem sass contains sass-converter utility, so you can use them.

Docs:

The sass-convert executable converts between CSS, Sass, and SCSS. When converting from CSS to Sass or SCSS, nesting is applied where appropriate. See sass-convert --help for further information and options.

bundle exec sass-convert ...

See sass-convert --help for further information and options.

Source file from github. Readme .

Gem repository .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM