【问题标题】:How to change the path when compile the bootstrap compass file编译引导罗盘文件时如何更改路径
【发布时间】: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


    【解决方案1】:

    您应该能够更改您的指南针配置并将 fonts_dir 设置为“fonts”而不是(看起来)“.tmp/styles/fonts”。

    【讨论】:

    • 您好,我在导入文件时在哪里可以指定@font 目录?我不想直接在凉亭组件内更改它。谢谢
    猜你喜欢
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    • 2020-04-15
    • 2016-11-26
    • 2020-04-29
    • 1970-01-01
    • 2023-04-07
    • 2019-12-20
    相关资源
    最近更新 更多