【发布时间】:2015-01-18 01:58:41
【问题描述】:
我已将 bootstrap-sass 添加到我的项目中,并像这样将其导入到我的 application.scss 文件中
@
import "../bower_components/bootstrap-sass/assets/stylesheets/_bootstrap-compass";
.bootstrap{
@import "../bower_components/bootstrap-sass/assets/stylesheets/_bootstrap";
}
在引导罗盘文件中,有函数
@function twbs-font-path($path) {
@return font-url($path, true);
}
@function twbs-image-path($path) {
@return image-url($path, true);
}
这将用于设置图像和字体的路径。
在我使用 compass 构建 css 文件后,css 文件的输出包含以下字体文件的路径
@font-face {
font-family: 'Glyphicons Halflings';
src: url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.eot);
src: url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"), url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.woff) format("woff"), url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.ttf) format("truetype"), url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg");
}
我怎样才能改变它,使源路径成为:
src: url(./fonts/bootstrap/glyphicons-halflings-regular.eot)
而不是 src:url(/.tmp/styles/fonts/bootstrap/glyphicons-halflings-regular.eot)
请注意,application.scss 是由 grunt-contrib-compass
构建的谢谢。
【问题讨论】:
标签: css gruntjs compass-sass angular-ui-bootstrap grunt-contrib-compass