【问题标题】:What is the correct usage of blueprint-typography-body([$font-size])?blueprint-typography-body([$font-size]) 的正确用法是什么?
【发布时间】:2011-02-19 18:03:41
【问题描述】:

最近转换为 RoR,我一直在使用 Compass w/ Blueprint 进入众所周知的池中。 Compass 非常棒,但我在 Typography 库中发现了一些奇怪的东西。

blueprint-typography-body mixin 包含以下内容:

=blueprint-typography-body($font-size: $blueprint-font-size)
  line-height: 1.5
  +normal-text
  font-size: 100% * $font-size / 16px

我的问题围绕着“字体大小”。我有点迷茫,因为我希望传递字体大小并在页面加载时反映该大小。但是,在这种情况下,公式似乎规定了默认字体的百分比。

即:

+blueprint-typography-body(10px) //produces 7.5px off of the default font size of 12px from what I can tell.

本质上,我很好奇 Compass 中是否有设置字体大小的标准,而不是明确声明“font-size: 10px”。

注意:我倾向于 Blueprint/Compass 字体样式的原因是行高、字体和颜色的标准化。

【问题讨论】:

    标签: sass blueprint-css compass-sass


    【解决方案1】:

    说实话,蓝图排版的指南针端口还不是完全可配置的。所以改变这个默认值可能不会给你一个正确的字体节奏。

    不过,susy 的下一个版本有一个完全可配置的垂直节奏模块,我帮助构建了它,它非常棒。

    Susy

    Vertical Rhythm Module

    【讨论】:

    • 有人拨打 404 应急小组!
    【解决方案2】:

    请阅读Compass documentation 的讨论(Julio Antúnez 的评论),您可以像这样调整字体大小:

    @import "compass/typography"
    
    $base-font-size:   14px
    $base-line-height: 21px
    
    header h1
      +adjust-font-size-to(18px)
    

    不确定这是推荐的方式,但它对我有用。我刚开始使用指南针和蓝图,所以上面可能会导致其他地方出现问题。

    【讨论】:

      猜你喜欢
      • 2013-07-25
      • 2013-02-16
      • 1970-01-01
      • 1970-01-01
      • 2021-02-22
      • 2018-04-24
      • 1970-01-01
      • 1970-01-01
      • 2020-02-13
      相关资源
      最近更新 更多