Modifying Bootstrap.css and updating the minified version in Visual Studio?

荒凉一梦 提交于 2019-12-23 07:25:58

问题


I am using VS Express 2013, trying to customize a bootstrap theme for a Roadkill wiki. I'm trying to replace the body color with a background image.

It's easy enough to modify the bootstrap.css, but in order to get site updates you need to push changes into bootstrap.min.css. So far, I am only aware of how to do this manually. I'm looking for any method whereby I can just have the minified version update automatically.

I'm guessing it's probably really simple to do, but I can't find any steps on how to do this.


回答1:


Just create your own css file and override just the css settings you want to change.

Be sure to load your override css after bootstrap so your overrides take precendence.

This way you dont need to edit either boostrap css at all.




回答2:


You are right in that it is really easy to do: see http://cssminifier.com/. I just pasted in the entire text of my custom bootstrap file, clicked "Minify", and copied the output back to overwrite the content of bootstrap.min.css. (I took a copy of the .min file first, just to be safe.)




回答3:


In Visual Studio 2013, if you are using ASP.NET MVC (you haven't mentioned which, but I suspect you are using MVC 5 since you are working with Roadkill wiki), bundling and optimizations to CSS and JavaScript files are done automatically when enabled, since the NuGet package Microsoft ASP.NET Web Optimization is installed.

From Microsoft, how to enable/disable... refer to the middle of the article "Controlling Bundling and Minification": http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification



来源:https://stackoverflow.com/questions/21892539/modifying-bootstrap-css-and-updating-the-minified-version-in-visual-studio

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