Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

Setting [$lines] in adjust-font-size-to breaks following rhythm #1584

Closed modermo closed 10 years ago

modermo commented 10 years ago

Observe the span behaviour in this Gist:

http://sassmeister.com/gist/9374486

You'll notice that it throws the proceeding elements to shift off the baseline by 1/3. whilst applying a margin-trailer of 4/3 to the span element fixes resets the following elements' adherence to the baseline, the bottom border of the span element is still still off.

Do you know of a fix to this?

mirisuzanne commented 10 years ago

If you set $lines to 2/3, then after 4 lines you will be 1/3 off your baseline. That's not a bug, that's how the rhythm module works. You are in control of your rhythm. If you want to stay on rhythm, any fractions have to add up to an integer.

In any case, there is nothing precise about vertical rhythms on the web. They are useful for giving a sense of consistent spacing, but trying to achieve 100% pixel-precision across browsers is not realistic. Compass can't do anything about that. We can make the math simpler, and provide shortcuts, but the rest is a matter of browser rendering and sub-pixel rounding.

modermo commented 10 years ago

Ok, nice. Makes sense. I thought there may have been a rule I wasn't considering.

Thanks for the response. The typography set of mixins are really great. :)

Sent from my iPod

On 5 Mar 2014, at 6:28 pm, "Eric M. Suzanne" notifications@github.com wrote:

If you set $lines to 2/3, then after 4 lines you will be 1/3 off your baseline. That's not a bug, that's how the rhythm module works. You are in control of your rhythm. If you want to stay on rhythm, any fractions have to add up to an integer.

In any case, there is nothing precise about vertical rhythms on the web. They are useful for giving a sense of consistent spacing, but trying to achieve 100% pixel-precision across browsers is not realistic. Compass can't do anything about that. We can make the math simpler, and provide shortcuts, but the rest is a matter of browser rendering and sub-pixel rounding.

— Reply to this email directly or view it on GitHub.