【发布时间】:2013-08-26 08:37:51
【问题描述】:
我想这样做:http://www.youtube.com/watch?v=ls3Clk-kz3s 但输出 rems(带有 px 后备)而不是 ems。
显然,这个https://github.com/chriseppstein/compass/pull/896 已添加到指南针中,并且应该以某种方式工作,但我不太清楚我需要从http://compass-style.org/reference/compass/typography/vertical_rhythm/ 到我的 .scss -file 来制作它。
如果我只是将 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 后备。
如果有人可以将 Vertical Rhythm 所需的完整 .scss 代码用于 Rems,我将不胜感激。
如果我使用 Rems,为什么我需要 $relative-font-sizing: false? 此外,除了将文本放到这样的网格中之外,是否还有一些关于垂直节奏的相互竞争的哲学?您更喜欢哪一个?您的工作流程是什么?
非常感谢您。
【问题讨论】:
标签: html css sass compass-sass mixins