Skip to content

Commit

Permalink
Allow controlling heading sizes on small screens
Browse files Browse the repository at this point in the history
Introduced variables $h1-font-reduction etc to allow customizing font sizes on mobile separately without overriding them in a custom stylesheet.
  • Loading branch information
danielck committed May 18, 2014
1 parent 3fe76b4 commit 596d5f9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scss/foundation/components/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ $h4-font-size: rem-calc(23) !default;
$h5-font-size: rem-calc(18) !default;
$h6-font-size: 1rem !default;

// We use these to control header size reduction on small screens
$h1-font-reduction: rem-calc(10) !default;
$h2-font-reduction: rem-calc(10) !default;
$h3-font-reduction: rem-calc(5) !default;
$h4-font-reduction: rem-calc(5) !default;
$h5-font-reduction: 0 !default;
$h6-font-reduction: 0 !default;

// These control how subheaders are styled.
$subheader-line-height: 1.4 !default;
$subheader-font-color: scale-color($header-font-color, $lightness: 35%) !default;
Expand Down Expand Up @@ -253,12 +261,12 @@ $align-class-breakpoints:
}
}

h1 { font-size: $h1-font-size - rem-calc(10); }
h2 { font-size: $h2-font-size - rem-calc(10); }
h3 { font-size: $h3-font-size - rem-calc(5); }
h4 { font-size: $h4-font-size - rem-calc(5); }
h5 { font-size: $h5-font-size; }
h6 { font-size: $h6-font-size; }
h1 { font-size: $h1-font-size - $h1-font-reduction; }
h2 { font-size: $h2-font-size - $h2-font-reduction; }
h3 { font-size: $h3-font-size - $h3-font-reduction; }
h4 { font-size: $h4-font-size - $h4-font-reduction; }
h5 { font-size: $h5-font-size - $h5-font-reduction; }
h6 { font-size: $h6-font-size - $h6-font-reduction; }

.subheader { @include subheader; }

Expand Down

0 comments on commit 596d5f9

Please sign in to comment.