gpt4 book ai didi

css - compass 字体混合粗体

转载 作者:行者123 更新时间:2023-11-28 10:21:09 26 4
gpt4 key购买 nike

我将 @font-face mixin 与 Compass (0.11.beta.1) 结合使用,但在定义粗体和斜体字体时遇到了问题。

我可以通过以下代码成功加载和使用字体:

@include font-face("PTSerif", font-files("/path/to/font/PTF55F_W.ttf", truetype), "/path/to/font/PTF55F_W.eot");

但是我找不到定义粗体字体的方法。消息来源说样式参数已被弃用,尝试使用它对输出 .css 文件没有影响。

@mixin font-face($name, $font-files, $eot: false, $postscript: false, $style: false) {
@if $postscript or $style {
@warn "The $postscript and $style variables have been deprecated in favor of the Paul Irish smiley bulletproof technique."; }
@font-face {
font-family: quote($name);
@if $eot {
src: font-url($eot); }
src: local("☺"), $font-files; } }

我目前有两个选择:

  1. 之后编辑 .css 文件。不利于可维护性
  2. 为不同的样式定义不同的字体(同样不理想,但目前最可行)例如

    @include font-face("PTSerif")
    @include font-face("PTSerif-B")

无法找到如何正确执行此操作的任何示例 - 能够使用 font-weight:bold;

提前致谢。

最佳答案

这是一个结合常规、粗体和斜体的例子,我已经很好地工作了:@font-face :: IM FELL ENGLISH .

关于css - compass 字体混合粗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5145963/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com