在一个。net MVC 5项目中建立引导程序和Bootswatch

时间:2021-07-12 12:21:13

I have an ASP .NET MVC 5 project. The template came with bootstrap, and I have generally left it alone. I now want to use the Bootstrap source as well as Bootswatch variables files for styles. Previously, I have put all the resources needed to build the libraries in to a separate project and written a custom build script, but there must be an easier way. I have found a few related packages, but none provide anything comprehensive.

我有一个asp.net MVC 5项目。这个模板是用bootstrap提供的,我通常会把它放在一边。现在,我想使用引导源文件和Bootswatch变量文件作为样式。以前,我已经将构建库所需的所有资源放在一个单独的项目中,并编写了一个自定义构建脚本,但是必须有一种更简单的方法。我找到了一些相关的包,但是没有一个包提供全面的内容。

Are there premade NuGet packages that will set up the two libraries? If not, what do I need to do to get it up-and-running (including automatic build in VS)?

是否有预先制作的NuGet包来设置这两个库?如果没有,我需要做什么才能使它正常运行(包括VS中的自动构建)?

1 个解决方案

#1


1  

Depending on the setup of your project, it may be better to get your Bootstrap-specific CSS from a CDN, even if using MVC.

根据项目的设置,最好从CDN获取特定于bootstrap的CSS,即使使用MVC。

Check Bootstrap CDN as well as their Bootswatch resources for quick easy usage:

检查引导CDN和它们的Bootswatch资源,以便快速使用:

<!-- Default Theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />

<!-- if you wanted Amelia, use this instead: -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/amelia/bootstrap.min.css" />

#1


1  

Depending on the setup of your project, it may be better to get your Bootstrap-specific CSS from a CDN, even if using MVC.

根据项目的设置,最好从CDN获取特定于bootstrap的CSS,即使使用MVC。

Check Bootstrap CDN as well as their Bootswatch resources for quick easy usage:

检查引导CDN和它们的Bootswatch资源,以便快速使用:

<!-- Default Theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />

<!-- if you wanted Amelia, use this instead: -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/amelia/bootstrap.min.css" />