在Meteor中有一个Glyphicons问题的Bootstrap主题

时间:2015-11-18 09:58:13

标签: css twitter-bootstrap meteor glyphicons bootswatch

首先,我以推荐的方式使用了bootswatch:readable主题 - 在<head>中链接到它。但是在我合并的自定义样式表之后加载Bootstrap并覆盖应该覆盖Bootstrap的内容。

然后我尝试用meteor add bootswatch:readable安装它,它会起作用,我的覆盖也会起作用,但问题是Glyphicons - 我会得到

Failed to decode downloaded font:
http://localhost:3000/packages/bootswatch_readable/bootswatch/fonts/glyphicons-halflings-regular.woff2
OTS parsing error: invalid version tag
http://localhost:3000/packages/bootswatch_readable/bootswatch/fonts/glyphicons-halflings-regular.woff
OTS parsing error: invalid version tag
http://localhost:3000/packages/bootswatch_readable/bootswatch/fonts/glyphicons-halflings-regular.ttf
OTS parsing error: invalid version tag

我看到图标路径可能不对,但不确定在何处或如何解决它。

1 个答案:

答案 0 :(得分:2)

发现this issue on GitHub指出了我的临时解决方案。

我使用meteor add bootswatch:readable安装了主题并将其添加到我自己的样式表中:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.eot');
  src: url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.eot?') format('embedded-opentype'),
    url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2') format('woff2'),
    url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.woff') format('woff'),
    url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
    url('packages/bootswatch_readable/bootstrap/dist/fonts/glyphicons-halflings-regular.svg') format('svg');
}

瞧,图标有效!