【问题标题】:SASS and Compass with WP and Font-face带有 WP 和字体的 SASS 和 Compass
【发布时间】:2013-04-10 02:20:22
【问题描述】:

我无法让字体在我的 sass 网站上正常工作。我是 sass 和 compass 的新手,除了字体,一切正常。

我生成了字体文件并将它们放在文件夹 library/font 中

在 config.rb 文件中,我添加了以下几行:

css_dir = "/"
sass_dir = "library/sass"
images_dir = "library/img"
fonts_dir = "library/font"
javascripts_dir = "library/js"

style.css 中生成的字体路径在开头有一个正斜杠。

src: url('///fonts/fontawesome-webfont-webfont.ttf') format('truetype'), url('///fonts/fontawesome-webfont-webfont.svg') format('svg'), url('///fonts/fontawesome-webfont-webfont.woff') format('woff'), url('///fonts/fontawesome-webfont-webfont.eot') format('embedded-opentype');

任何想法我做错了什么?

【问题讨论】:

  • 调用你的字体文件的 Sass 是什么样的?
  • 不仅仅是斜线。生成的路径与您在配置中得到的完全不同。

标签: sass font-face compass-sass


【解决方案1】:

是的,scr: 中调用的字体名称不正确。然而这并没有解决我的问题。

字体正在生成并且在字体文件夹的路径名前有一个/。所以我不得不在 config.rb 文件中添加这一行来修复它:

relative_assets = true

我不确定这是否是让这一切正常工作的正确方法。所以下次有任何建议都会很棒。

感谢大家的宝贵时间。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-29
    • 2012-09-23
    • 1970-01-01
    • 1970-01-01
    • 2016-11-28
    • 2011-10-04
    • 2012-07-20
    • 2011-10-03
    相关资源
    最近更新 更多