简体   繁体   中英

generate css from scss

I have scss and css files in ASP.NET project.

截图

If I change scss, should be css be regenerated? If yes, then how? VS can do this or should I have some other tool?

There are extensions that allow you to regenerate from inside Visual Studio, but I personally prefer the command line way.

sass --watch [folder holding .scss files]:[folder holding .css files]

If you use Compass, you can use this command instead:

compass watch

Both of these commands will tell Sass to watch the folder with the .scss files, and any time they're changed and saved, regenerate the CSS files.

If you created the project, then you likely already have Sass (and, by extension, Ruby) installed. If you don't, you'll need to install Ruby and Sass. Windows has a nice little installer that installs both Ruby and RubyGems. Once it's installed, you'll need to run the following to install Sass:

gem install sass

Once Sass is installed, you can either run the sass --watch command, or use a VS extension of your choice to watch and recompile the CSS files.

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