我希望做到这一点:http://www.youtube.com/watch?v=ls3Clk-kz3s,但要输出rems(具有px回退),而不是ems。
显然,compass添加了https://github.com/chriseppstein/compass/pull/896,应该可以工作,但我不太明白我需要从http://compass-style.org/reference/compass/typography/vertical_rhythm/中获取什么内容并将其添加到我的 .scss 文件中。
如果只是使用来自https://gist.github.com/ry5n/2026666的mixin代码(即使完全没有使用Compass),可以使用以下代码:
显然,compass添加了https://github.com/chriseppstein/compass/pull/896,应该可以工作,但我不太明白我需要从http://compass-style.org/reference/compass/typography/vertical_rhythm/中获取什么内容并将其添加到我的 .scss 文件中。
如果只是使用来自https://gist.github.com/ry5n/2026666的mixin代码(即使完全没有使用Compass),可以使用以下代码:
@include set-font-size()
替代方案:
@include adjust-font-size-to()
它可以很好地处理rem值和px备用。
但如果我只是尝试使用Compass,然后继续进行
$font-unit: 1rem;
$relative-font-sizing: false;
它能工作,但没有px回退。
如果有人能提供完整的.scss代码,以便使用Rems实现Vertical Rhythm,我会非常感激。
如果我使用Rems,为什么需要$relative-font-sizing: false?此外,除了像这样将文本放在网格中之外,是否还有其他竞争哲学?你更喜欢哪一个,你的工作流程是什么?
非常感谢您提前的帮助。
adjust-font-size-to
、leader
、trailer
、leading-border
等等。唯一没有像素回退的是 函数,其中rhythm()
是我真正使用的唯一一个。由于这些函数仅计算节奏值(而不输出 CSS),因此它们无法提供像素回退。 - ry5n