diff options
author | JohnAlbin <virtually.johnalbin@gmail.com> | 2015-11-17 19:02:32 +0300 |
---|---|---|
committer | JohnAlbin <virtually.johnalbin@gmail.com> | 2015-11-17 19:02:32 +0300 |
commit | f32a7fdae314297ee053d6588d7ea913aeb7fb4b (patch) | |
tree | 9991b5a14f5263a611ebcb514687da3eb45c6bf0 /sass | |
parent | 1c09e98a9866f2a5099d72c83e31b27804e831c0 (diff) |
Add 3rd party support-for dependency.
Diffstat (limited to 'sass')
-rw-r--r-- | sass/_normalize.scss | 2 | ||||
-rw-r--r-- | sass/normalize/_normalize-mixin.scss | 50 | ||||
-rw-r--r-- | sass/normalize/_support-for.scss | 41 | ||||
-rw-r--r-- | sass/normalize/_variables.scss | 29 | ||||
-rw-r--r-- | sass/normalize/_vertical-rhythm.scss | 4 |
5 files changed, 28 insertions, 98 deletions
diff --git a/sass/_normalize.scss b/sass/_normalize.scss index 4679a6e..ba09c5d 100644 --- a/sass/_normalize.scss +++ b/sass/_normalize.scss @@ -1,4 +1,4 @@ +@import 'support-for'; @import 'normalize/variables'; -@import 'normalize/support-for'; @import 'normalize/vertical-rhythm'; @import 'normalize/normalize-mixin'; diff --git a/sass/normalize/_normalize-mixin.scss b/sass/normalize/_normalize-mixin.scss index f9b515d..2cfafd8 100644 --- a/sass/normalize/_normalize-mixin.scss +++ b/sass/normalize/_normalize-mixin.scss @@ -42,7 +42,7 @@ $_normalize-exclude: (); */ html { - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or 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%; @@ -100,9 +100,9 @@ $_normalize-exclude: (); canvas, progress, video { - @if normalize-support-for(ie, 9) { + @if support-for(ie, 9) { display: inline-block; /* 1 */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { *display: inline; *zoom: 1; } @@ -120,7 +120,7 @@ $_normalize-exclude: (); height: 0; } - @if normalize-support-for(ie, 10) { + @if support-for(ie, 10) { /** * Address `[hidden]` styling not present in IE 8/9/10. */ @@ -143,7 +143,7 @@ $_normalize-exclude: (); /* Links ========================================================================== */ - @if normalize-support-for(ie, 10) { + @if support-for(ie, 10) { /** * Remove the gray background color from active links in IE 10. */ @@ -185,7 +185,7 @@ $_normalize-exclude: (); font-weight: bold; } - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or support-for(ie, 7) { /** * Set 1 unit of vertical rhythm on the top and bottom margin. */ @@ -218,7 +218,7 @@ $_normalize-exclude: (); @include normalize-margin(1 0, $h1-font-size); } - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or support-for(ie, 7) { h2 { @include normalize-font-size($h2-font-size); @if $normalize-vertical-rhythm { @@ -260,7 +260,7 @@ $_normalize-exclude: (); } } - @if normalize-support-for(ie, 9) { + @if support-for(ie, 9) { /** * Address styling not present in IE 8/9. */ @@ -271,7 +271,7 @@ $_normalize-exclude: (); } } - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or support-for(ie, 7) { /** * Set 1 unit of vertical rhythm on the top and bottom margin. */ @@ -312,7 +312,7 @@ $_normalize-exclude: (); } @if _normalize-include(lists) { - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or support-for(ie, 7) { /* Lists ========================================================================== */ @@ -342,7 +342,7 @@ $_normalize-exclude: (); } } - @if $normalize-vertical-rhythm or normalize-support-for(ie, 7) { + @if $normalize-vertical-rhythm or support-for(ie, 7) { dd { margin: 0 0 0 $indent-amount; } @@ -358,7 +358,7 @@ $_normalize-exclude: (); } } - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { /** * Correct list images handled incorrectly in IE 7. */ @@ -375,14 +375,14 @@ $_normalize-exclude: (); /* Embedded content ========================================================================== */ - @if normalize-support-for(ie, 10) { + @if support-for(ie, 10) { /** * Remove border when inside `a` element in IE 8/9/10. */ img { border: 0; - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { /* Improve image quality when scaled in IE 7. */ -ms-interpolation-mode: bicubic; } @@ -402,7 +402,7 @@ $_normalize-exclude: (); /* Grouping content ========================================================================== */ - @if $normalize-vertical-rhythm or normalize-support-for(ie, 9) or normalize-support-for(safari, 6) { + @if $normalize-vertical-rhythm or support-for(ie, 9) or support-for(safari, 6) { /** * Address margin not present in IE 8/9 and Safari. */ @@ -417,7 +417,7 @@ $_normalize-exclude: (); */ hr { - @if normalize-support-for(firefox, 28) { + @if support-for(firefox, 28) { -moz-box-sizing: content-box; } box-sizing: content-box; @@ -441,7 +441,7 @@ $_normalize-exclude: (); pre, samp { font-family: monospace, monospace; - @if normalize-support-for(ie, 6) { + @if support-for(ie, 6) { _font-family: 'courier new', monospace; } font-size: 1em; @@ -457,7 +457,7 @@ $_normalize-exclude: (); * styling of `select`, unless a `border` property is set. */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { /** * Correct margin displayed oddly in IE 6/7. */ @@ -484,7 +484,7 @@ $_normalize-exclude: (); color: inherit; /* 1 */ font: inherit; /* 2 */ margin: 0; /* 3 */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { *font-family: $base-font-family; /* 4 */ *vertical-align: middle; /* 5 */ } @@ -526,7 +526,7 @@ $_normalize-exclude: (); input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { *overflow: visible; /* 4 */ } } @@ -559,7 +559,7 @@ $_normalize-exclude: (); line-height: normal; } - @if normalize-support-for(ie, 10) { + @if support-for(ie, 10) { /** * It's recommended that you don't attempt to style these elements. * Firefox's implementation doesn't respect box-sizing, padding, or width. @@ -574,7 +574,7 @@ $_normalize-exclude: (); input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { *height: 13px; /* 3 */ *width: 13px; /* 3 */ } @@ -599,7 +599,7 @@ $_normalize-exclude: (); input[type="search"] { -webkit-appearance: textfield; /* 1 */ - @if normalize-support-for(safari, 5) or normalize-support-for(chrome, 9) { + @if support-for(safari, 5) or support-for(chrome, 9) { -webkit-box-sizing: content-box; } box-sizing: content-box; /* 2 */ @@ -633,11 +633,11 @@ $_normalize-exclude: (); */ legend { - @if normalize-support-for(ie, 11) { + @if support-for(ie, 11) { border: 0; /* 1 */ } padding: 0; /* 2 */ - @if normalize-support-for(ie, 7) { + @if support-for(ie, 7) { *margin-left: -7px; /* 3 */ } } diff --git a/sass/normalize/_support-for.scss b/sass/normalize/_support-for.scss deleted file mode 100644 index 129b2ec..0000000 --- a/sass/normalize/_support-for.scss +++ /dev/null @@ -1,41 +0,0 @@ -// normalize-support-for() -// -// Determines if the project has declared a minimum supported version number for -// the specified browser. -// -// If configured, this is a wrapper function that uses Compass' -// support-legacy-browser(). -// @see http://compass-style.org/reference/compass/support/#function-support-legacy-browser -// -@function normalize-support-for($browser, $version) { - // Ensure $version is an integer (or null). - @if not (type-of($version) == "null" or type-of($version) == "number" and round($version) == $version) { - @error "The $version parameter of normalize-support-for() must be an integer; #{inspect($version)} given."; - } - - @if function-exists('support-legacy-browser') { - // We want $version to be an integer, but Compass' function requires a string. - @return support-legacy-browser($browser, inspect($version)); - } - - // Check against declared minimums. - $min-version: if(map-has-key($normalize-support-for, $browser), map-get($normalize-support-for, $browser), null); - - // Ensure $min-version is an integer (or null). - @if type-of($min-version) != "null" and type-of($min-version) != "number" { - @error "$normalize-support-for: (#{$browser}: #{$min-version}) must be set to an integer (or null); #{$min-version} is a #{type-of($min-version)}."; - } - @elseif type-of($min-version) == "number" and round($min-version) != $min-version { - @error "$normalize-support-for: (#{$browser}: #{$min-version}) must be set to an integer (or null); #{$min-version} is not an integer."; - } - - // Negative $min-version means "X most recent versions". - @if type-of($min-version) == "number" and $min-version < 0 { - @if not map-has-key($normalize-current-browser-version, $browser) { - @error "$normalize-current-browser-version: (#{$browser}: null) must be set to an integer."; - } - $min-version: map-get($normalize-current-browser-version, $browser) + $min-version + 1; - } - - @return ($min-version and ($version >= $min-version)); -} diff --git a/sass/normalize/_variables.scss b/sass/normalize/_variables.scss index aae80d8..2f06b25 100644 --- a/sass/normalize/_variables.scss +++ b/sass/normalize/_variables.scss @@ -34,32 +34,3 @@ $indent-amount: 40px !default; // 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, - edge: 20, - firefox: 39, - ie: 9, - opera: null, - safari: 6, -) !default; - -// Ensure there is an entry for every browser. -$normalize-support-for: map-merge(( - chrome: null, - edge: null, - firefox: null, - ie: null, - opera: null, - safari: null, -), $normalize-support-for); - -$normalize-current-browser-version: ( - chrome: 46, - edge: 25, - firefox: 42, - ie: 11, - opera: 33, - safari: 9, -) !default; diff --git a/sass/normalize/_vertical-rhythm.scss b/sass/normalize/_vertical-rhythm.scss index d849a4b..1f3f04a 100644 --- a/sass/normalize/_vertical-rhythm.scss +++ b/sass/normalize/_vertical-rhythm.scss @@ -26,7 +26,7 @@ } // px fallback for IE 8 and earlier. Note: IE 9/10 don't understand rem // in font shorthand, but font-size longhand is fine. - @if $base-unit == rem and normalize-support-for(ie, 8) { + @if $base-unit == rem and support-for(ie, 8) { font-size: $value; } font-size: normalize-rhythm($value, $relative-to); @@ -48,7 +48,7 @@ } $normalized-values: append($normalized-values, $value); } - @if $base-unit == rem and normalize-support-for(ie, 8) { + @if $base-unit == rem and support-for(ie, 8) { #{$property}: $px-fallback; } #{$property}: $normalized-values; |