blueprint-typography-body([$ font-size])的正确用法是什么?

时间:2010-05-14 22:38:35

标签: sass blueprint-css compass-sass

最近转换为RoR,我一直在使用Compass w/ Blueprint进入众所周知的游泳池。指南针很棒,但我在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

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

即:

+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字体样式的原因是由于行高,字体和颜色的标准化。

2 个答案:

答案 0 :(得分:1)

说实话,蓝图排版的罗盘端口还不完全可配置。因此,更改默认设置可能无法为您提供正确的字体节奏。

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

Susy

Vertical Rhythm Module

答案 1 :(得分:0)

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

@import "compass/typography"

$base-font-size:   14px
$base-line-height: 21px

header h1
  +adjust-font-size-to(18px)

不确定这是推荐方式,但它对我有用。我刚刚开始使用Compass&上面的蓝图可能会在其他地方引起问题。