When headings (like h1, h2, etc.) get split across lines in the Ohm theme, the heading text overlaps with itself, because the font-size is 34px (for h2, e.g.) while the line-height is only 20px. See the line-height-broken.png attachment. This is a result of the way the font size is set in ohm/sass/base/_typography.scss
:
h2, .beta {
@include font-size(34px);
font-weight: 700;
color: $mid-blue;
}
The @font-size
mixin (defined in ohm/sass/abstractions/_typography.scss
) sets the font-size in rems, but doesn't touch the line-height, which is set to 20px in ohm/sass/variables/_typography.scss
by setting the Compass Vertical Rhythm variable $base-line-height
.
One way to fix this would be to use the Compass Vertical Rhythm mixin adjust-font-size-to()
, like so:
h2, .beta {
@include adjust-font-size-to(34px);
font-weight: 700;
color: $mid-blue;
}
This mixin also sets the line-height, taking the base-line-height into consideration. The line-height-fixed.png attachment shows what this looks like.
Comment | File | Size | Author |
---|---|---|---|
line-height-fixed.png | 91.12 KB | David Eisner | |
line-height-broken.png | 89.26 KB | David Eisner |
Comments
Comment #1
couloir007 CreditAttribution: couloir007 commentedThis adjusts the line-height, but removes the fallback px.
Comment #2
hawkdavis CreditAttribution: hawkdavis commentedwhat about adding this function
then changing the mixin to this?