diff options
author | JohnAlbin <virtually.johnalbin@gmail.com> | 2015-11-15 08:17:22 +0300 |
---|---|---|
committer | JohnAlbin <virtually.johnalbin@gmail.com> | 2015-11-15 08:17:22 +0300 |
commit | 78bfa994fb4deab98e1ad989615583bef90cdebc (patch) | |
tree | d50b396bd1845dff67762aea866b53ad903c219e /sass | |
parent | 08ea3ea66732b4d62add41f3819cec9c4f243854 (diff) |
Add $normalize-vertical-rhythm to force line-heights when using default variable values.
Diffstat (limited to 'sass')
-rw-r--r-- | sass/_normalize.scss | 35 | ||||
-rw-r--r-- | sass/normalize/_variables.scss | 7 |
2 files changed, 24 insertions, 18 deletions
diff --git a/sass/_normalize.scss b/sass/_normalize.scss index 4c40c9b..3780a37 100644 --- a/sass/_normalize.scss +++ b/sass/_normalize.scss @@ -3,8 +3,7 @@ @import 'normalize/font-values'; -// If we've customized any font sizes, we'll need extra properties. -$_normalize-font-sizes: false; +// If we've customized any font variables, we'll need extra properties. @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' @@ -15,7 +14,7 @@ $_normalize-font-sizes: false; or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px { - $_normalize-font-sizes: true; + $normalize-vertical-rhythm: true; } /** @@ -25,12 +24,12 @@ $_normalize-font-sizes: false; */ html { - @if $_normalize-font-sizes or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { // Correct text resizing oddly in IE 6/7 when body `font-size` is set using // `em` units. font-size: ($base-font-size / 16px) * 100%; } - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { line-height: ($base-line-height / $base-font-size) * 1em; } font-family: $base-font-family; /* 1 */ @@ -162,7 +161,7 @@ strong { font-weight: bold; } -@if $_normalize-font-sizes or normalize-support-for(ie, 7) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { /** * Set 1 unit of vertical rhythm on the top and bottom margin. */ @@ -187,7 +186,7 @@ dfn { h1 { @include normalize-font-size($h1-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h1-font-size); } @@ -196,10 +195,10 @@ h1 { @include normalize-rhythm(margin-bottom, 1, $h1-font-size); } -@if $_normalize-font-sizes or normalize-support-for(ie, 7) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { h2 { @include normalize-font-size($h2-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h2-font-size); } @include normalize-rhythm(margin-top, 1, $h2-font-size); @@ -208,7 +207,7 @@ h1 { h3 { @include normalize-font-size($h3-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h3-font-size); } @include normalize-rhythm(margin-top, 1, $h3-font-size); @@ -217,7 +216,7 @@ h1 { h4 { @include normalize-font-size($h4-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h4-font-size); } @include normalize-rhythm(margin-top, 1, $h4-font-size); @@ -226,7 +225,7 @@ h1 { h5 { @include normalize-font-size($h5-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h5-font-size); } @include normalize-rhythm(margin-top, 1, $h5-font-size); @@ -235,7 +234,7 @@ h1 { h6 { @include normalize-font-size($h6-font-size); - @if $_normalize-font-sizes { + @if $normalize-vertical-rhythm { @include normalize-line-height($h6-font-size); } @include normalize-rhythm(margin-top, 1, $h6-font-size); @@ -254,7 +253,7 @@ h1 { } } -@if $_normalize-font-sizes or normalize-support-for(ie, 7) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { /** * Set 1 unit of vertical rhythm on the top and bottom margin. */ @@ -293,7 +292,7 @@ sub { bottom: -0.25em; } -@if $_normalize-font-sizes or normalize-support-for(ie, 7) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { /* Lists ========================================================================== */ @@ -309,7 +308,7 @@ sub { } } -@if $_normalize-font-sizes { +@if $normalize-vertical-rhythm { /** * Turn off margins on nested lists. */ @@ -323,7 +322,7 @@ sub { } } -@if $_normalize-font-sizes or normalize-support-for(ie, 7) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { dd { margin: 0 0 0 $indent-amount; } @@ -379,7 +378,7 @@ svg:not(:root) { /* Grouping content ========================================================================== */ -@if $_normalize-font-sizes or normalize-support-for(ie, 9) or normalize-support-for(safari, 6) { +@if $normalize-vertical-rhythm or normalize-support-for(ie, 9) or normalize-support-for(safari, 6) { /** * Address margin not present in IE 8/9 and Safari. */ diff --git a/sass/normalize/_variables.scss b/sass/normalize/_variables.scss index 9b4bd39..041a7d9 100644 --- a/sass/normalize/_variables.scss +++ b/sass/normalize/_variables.scss @@ -26,6 +26,13 @@ $h6-font-size: 0.67 * $base-font-size !default; // The amount lists and blockquotes are indented. $indent-amount: 40px !default; +// The following variable controls whether normalize-scss will output +// font-sizes, line-heights and block-level top/bottom margins that form a basic +// vertical rhythm on the page, which differs from the original Normalize.css. +// However, changing any of the variables above will cause +// $normalize-vertical-rhythm to be automatically set to true. +$normalize-vertical-rhythm: false !default; + // Support the same browsers as normalize.css v3. $normalize-support-for: ( chrome: 43, |