twitter-bootstrap 修改 Bootstrap.css 并更新 Visual Studio 中的缩小版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21892539/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Modifying Bootstrap.css and updating the minified version in Visual Studio?
提问by iontom
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.
我正在使用 VS Express 2013,尝试为 Roadkill wiki 自定义引导程序主题。我正在尝试用背景图像替换主体颜色。
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.
修改 bootstrap.css 很容易,但为了获得站点更新,您需要将更改推送到 bootstrap.min.css。到目前为止,我只知道如何手动执行此操作。我正在寻找任何可以自动更新缩小版本的方法。
I'm guessing it's probably really simple to do, but I can't find any steps on how to do this.
我猜这可能真的很简单,但我找不到有关如何执行此操作的任何步骤。
回答by Mark Worrall
Just create your own css file and override just the css settings you want to change.
只需创建您自己的 css 文件并仅覆盖您想要更改的 css 设置。
Be sure to load your override css after bootstrap so your overrides take precendence.
确保在引导后加载您的覆盖 css,以便您的覆盖优先。
This way you dont need to edit either boostrap css at all.
这样你根本不需要编辑任何一个 boostrap css。
回答by PiersB
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.)
你是对的,它真的很容易做到:参见http://cssminifier.com/。我刚刚粘贴了自定义引导程序文件的整个文本,单击“缩小”,然后将输出复制回以覆盖 bootstrap.min.css 的内容。(为了安全起见,我先复制了 .min 文件。)
回答by Thomas Veil
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.
在 Visual Studio 2013 中,如果您使用的是 ASP.NET MVC(您没有提到哪个,但我怀疑您使用的是 MVC 5,因为您正在使用 Roadkill wiki),当启用,因为安装了 NuGet 包 Microsoft ASP.NET Web Optimization。
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
从微软,如何启用/禁用...参考文章中间的“控制捆绑和缩小”:http: //www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification

