【问题标题】:Bower + bootstrap theme - how to include fonts?Bower + bootstrap 主题 - 如何包含字体?
【发布时间】:2023-03-15 03:10:02
【问题描述】:

我想在我的应用程序中使用引导主题 Lumen。我已经通过bower 安装了它的纯 js 和 css:

/* part of bower.json */
{
  "bootstrap.min.css": "https://bootswatch.com/lumen/bootstrap.min.css",
  "bootstrap.min.js": "https://bootswatch.com/lumen/bootstrap.min.css"
}

因此,bower_components/bootstrap.min.css/index.cssbower_components/bootstrap.min.js/index.js 中安装了两个文件。 index.cssfont_face 选项需要../fonts/glyphicon-font-name.woff。所以,引导程序的所有字体都应该放在bower_components/fonts

当然,我可以安装bootstrap bower 包,然后在每个bower install 之后运行grunt-copy,但是这种方法似乎是错误的。如何在我的./index.html 上执行此字体要求对吗?

【问题讨论】:

  • 复制图像和字体等依赖项的唯一方法是grunt-copy。您可以向 bower 添加一个安装后挂钩以复制字体。
  • @AhmadAlfy 你的意思是每个通过凉亭复制粘贴字体文件安装引导程序的人吗?这似乎很奇怪。我认为应该有一个干净的方式

标签: twitter-bootstrap fonts gruntjs bower


【解决方案1】:

您可以安装 bower 包 bootswatch-dist - bootswatch 主题的分发包。
要安装 3.3.5 lumen 版本,请将以下依赖项添加到 bower.json

"dependencies": {
 "bootswatch-dist": "3.3.5-lumen"
}

【讨论】:

  • 很酷的解决方案。谢谢!
猜你喜欢
  • 2014-09-05
  • 1970-01-01
  • 2014-08-07
  • 2021-02-23
  • 2016-04-10
  • 1970-01-01
  • 1970-01-01
  • 2021-09-15
  • 1970-01-01
相关资源
最近更新 更多