diff --git a/LICENSE.md b/LICENSE.md index 3dbc75d07..ea5daefc3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright © 2011–2015 [thoughtbot, inc.](http://thoughtbot.com) +Copyright © 2011–2017 [thoughtbot, inc.](http://thoughtbot.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal diff --git a/README.md b/README.md index fd8228dee..fd2b59fd6 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ Also check out [Proteus](https://github.com/thoughtbot/proteus), a collection of ## License -Copyright © 2011–2015 [thoughtbot, inc](http://thoughtbot.com). +Copyright © 2011–2017 [thoughtbot, inc](http://thoughtbot.com). Bourbon is free software, and may be redistributed under the terms specified in the [license](LICENSE.md). diff --git a/app/assets/stylesheets/_bourbon-deprecate.scss b/app/assets/stylesheets/_bourbon-deprecate.scss new file mode 100644 index 000000000..f7c980d08 --- /dev/null +++ b/app/assets/stylesheets/_bourbon-deprecate.scss @@ -0,0 +1,19 @@ +@charset "UTF-8"; + +/// Throws Sass warnings to announce library deprecations. You can disable them +/// by setting the `$output-bourbon-deprecation-warnings` variable to `false`. +/// +/// @access private + +@mixin _bourbon-deprecate($feature, $message: null) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `#{$feature}` is deprecated and will be " + + "removed in 5.0.0. #{$message}"; + @content; + } +} + +@mixin _bourbon-deprecate-for-prefixing($feature) { + @include _bourbon-deprecate($feature, "We suggest using an automated " + + "prefixing tool, like Autoprefixer."); +} diff --git a/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss b/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss index e6d1b8cec..7b4242103 100644 --- a/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss +++ b/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss @@ -1,12 +1,13 @@ // The following features have been deprecated and will be removed in the next MAJOR version release @mixin inline-block { - display: inline-block; + @include _bourbon-deprecate("inline-block"); - @warn "The inline-block mixin is deprecated and will be removed in the next major version release"; + display: inline-block; } @mixin button ($style: simple, $base-color: #4294f0, $text-size: inherit, $padding: 7px 18px) { + @include _bourbon-deprecate("button"); @if type-of($style) == string and type-of($base-color) == color { @include buttonstyle($style, $base-color, $text-size, $padding); @@ -60,8 +61,6 @@ cursor: not-allowed; opacity: 0.5; } - - @warn "The button mixin is deprecated and will be removed in the next major version release"; } // Selector Style Button @@ -377,35 +376,50 @@ // Flexible grid @function flex-grid($columns, $container-columns: $fg-max-columns) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `flex-grid` is deprecated and will be " + + "removed in 5.0.0. For grid functions, check out Bourbon's sister library" + + "Neat."; + } + $width: $columns * $fg-column + ($columns - 1) * $fg-gutter; $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; @return percentage($width / $container-width); - - @warn "The flex-grid function is deprecated and will be removed in the next major version release"; } // Flexible gutter @function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `flex-gutter` is deprecated and will be " + + "removed in 5.0.0. For grid functions, check out Bourbon's sister library" + + "Neat."; + } + $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; @return percentage($gutter / $container-width); - - @warn "The flex-gutter function is deprecated and will be removed in the next major version release"; } @function grid-width($n) { - @return $n * $gw-column + ($n - 1) * $gw-gutter; + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `grid-width` is deprecated and will be " + + "removed in 5.0.0. For grid functions, check out Bourbon's sister library" + + "Neat."; + } - @warn "The grid-width function is deprecated and will be removed in the next major version release"; + @return $n * $gw-column + ($n - 1) * $gw-gutter; } @function golden-ratio($value, $increment) { - @return modular-scale($increment, $value, $ratio: $golden); + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `golden-ratio` is deprecated and will be " + + "removed in 5.0.0. You can use the `modular-scale` function instead."; + } - @warn "The golden-ratio function is deprecated and will be removed in the next major version release. Please use the modular-scale function, instead."; + @return modular-scale($increment, $value, $ratio: $golden); } @mixin box-sizing($box) { - @include prefixer(box-sizing, $box, webkit moz spec); + @include _bourbon-deprecate-for-prefixing("box-sizing"); - @warn "The box-sizing mixin is deprecated and will be removed in the next major version release. This property can now be used un-prefixed."; + @include prefixer(box-sizing, $box, webkit moz spec); } diff --git a/app/assets/stylesheets/_bourbon.scss b/app/assets/stylesheets/_bourbon.scss index 635c68041..3d9be2bb8 100644 --- a/app/assets/stylesheets/_bourbon.scss +++ b/app/assets/stylesheets/_bourbon.scss @@ -1,12 +1,15 @@ -// Bourbon 4.2.7 +// Bourbon 4.3.0 // http://bourbon.io -// Copyright 2011-2015 thoughtbot, inc. +// Copyright 2011-2017 thoughtbot, inc. // MIT License +@import "settings/deprecation-warnings"; @import "settings/prefixer"; @import "settings/px-to-em"; @import "settings/asset-pipeline"; +@import "bourbon-deprecate"; + @import "functions/assign-inputs"; @import "functions/contains"; @import "functions/contains-falsy"; diff --git a/app/assets/stylesheets/addons/_retina-image.scss b/app/assets/stylesheets/addons/_retina-image.scss index 7febbd751..ea659eebd 100644 --- a/app/assets/stylesheets/addons/_retina-image.scss +++ b/app/assets/stylesheets/addons/_retina-image.scss @@ -1,4 +1,6 @@ @mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) { + @include _bourbon-deprecate("retina-image"); + @if $asset-pipeline { background-image: image-url("#{$filename}.#{$extension}"); } @else { diff --git a/app/assets/stylesheets/css3/_animation.scss b/app/assets/stylesheets/css3/_animation.scss index aac675f5a..87c3c5972 100644 --- a/app/assets/stylesheets/css3/_animation.scss +++ b/app/assets/stylesheets/css3/_animation.scss @@ -2,42 +2,60 @@ // Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties. @mixin animation($animations...) { + @include _bourbon-deprecate-for-prefixing("animation"); + @include prefixer(animation, $animations, webkit moz spec); } @mixin animation-name($names...) { + @include _bourbon-deprecate-for-prefixing("animation-name"); + @include prefixer(animation-name, $names, webkit moz spec); } @mixin animation-duration($times...) { + @include _bourbon-deprecate-for-prefixing("animation-duration"); + @include prefixer(animation-duration, $times, webkit moz spec); } @mixin animation-timing-function($motions...) { + @include _bourbon-deprecate-for-prefixing("animation-timing-function"); + // ease | linear | ease-in | ease-out | ease-in-out @include prefixer(animation-timing-function, $motions, webkit moz spec); } @mixin animation-iteration-count($values...) { + @include _bourbon-deprecate-for-prefixing("animation-iteration-count"); + // infinite | @include prefixer(animation-iteration-count, $values, webkit moz spec); } @mixin animation-direction($directions...) { + @include _bourbon-deprecate-for-prefixing("animation-direction"); + // normal | alternate @include prefixer(animation-direction, $directions, webkit moz spec); } @mixin animation-play-state($states...) { + @include _bourbon-deprecate-for-prefixing("animation-play-state"); + // running | paused @include prefixer(animation-play-state, $states, webkit moz spec); } @mixin animation-delay($times...) { + @include _bourbon-deprecate-for-prefixing("animation-delay"); + @include prefixer(animation-delay, $times, webkit moz spec); } @mixin animation-fill-mode($modes...) { + @include _bourbon-deprecate-for-prefixing("animation-fill-mode"); + // none | forwards | backwards | both @include prefixer(animation-fill-mode, $modes, webkit moz spec); } diff --git a/app/assets/stylesheets/css3/_appearance.scss b/app/assets/stylesheets/css3/_appearance.scss index abddc0204..4a6005275 100644 --- a/app/assets/stylesheets/css3/_appearance.scss +++ b/app/assets/stylesheets/css3/_appearance.scss @@ -1,3 +1,5 @@ @mixin appearance($value) { + @include _bourbon-deprecate-for-prefixing("appearance"); + @include prefixer(appearance, $value, webkit moz ms o spec); } diff --git a/app/assets/stylesheets/css3/_backface-visibility.scss b/app/assets/stylesheets/css3/_backface-visibility.scss index fc68e2dd0..3766f6ec6 100644 --- a/app/assets/stylesheets/css3/_backface-visibility.scss +++ b/app/assets/stylesheets/css3/_backface-visibility.scss @@ -1,3 +1,5 @@ @mixin backface-visibility($visibility) { + @include _bourbon-deprecate-for-prefixing("backface-visibility"); + @include prefixer(backface-visibility, $visibility, webkit spec); } diff --git a/app/assets/stylesheets/css3/_background-image.scss b/app/assets/stylesheets/css3/_background-image.scss index 6ed19ab58..b252aaa17 100644 --- a/app/assets/stylesheets/css3/_background-image.scss +++ b/app/assets/stylesheets/css3/_background-image.scss @@ -4,6 +4,8 @@ //************************************************************************// @mixin background-image($images...) { + @include _bourbon-deprecate-for-prefixing("background-image"); + $webkit-images: (); $spec-images: (); diff --git a/app/assets/stylesheets/css3/_background.scss b/app/assets/stylesheets/css3/_background.scss index 019db0ed3..350ac1453 100644 --- a/app/assets/stylesheets/css3/_background.scss +++ b/app/assets/stylesheets/css3/_background.scss @@ -4,6 +4,8 @@ //************************************************************************// @mixin background($backgrounds...) { + @include _bourbon-deprecate-for-prefixing("background"); + $webkit-backgrounds: (); $spec-backgrounds: (); diff --git a/app/assets/stylesheets/css3/_border-image.scss b/app/assets/stylesheets/css3/_border-image.scss index cf568ce6d..42451c73f 100644 --- a/app/assets/stylesheets/css3/_border-image.scss +++ b/app/assets/stylesheets/css3/_border-image.scss @@ -1,4 +1,6 @@ @mixin border-image($borders...) { + @include _bourbon-deprecate-for-prefixing("border-image"); + $webkit-borders: (); $spec-borders: (); diff --git a/app/assets/stylesheets/css3/_calc.scss b/app/assets/stylesheets/css3/_calc.scss index 0bfc738dd..8acda5ffe 100644 --- a/app/assets/stylesheets/css3/_calc.scss +++ b/app/assets/stylesheets/css3/_calc.scss @@ -1,4 +1,6 @@ @mixin calc($property, $value) { + @include _bourbon-deprecate-for-prefixing("calc"); + #{$property}: -webkit-calc(#{$value}); #{$property}: calc(#{$value}); } diff --git a/app/assets/stylesheets/css3/_columns.scss b/app/assets/stylesheets/css3/_columns.scss index 96117670c..e7d2dda33 100644 --- a/app/assets/stylesheets/css3/_columns.scss +++ b/app/assets/stylesheets/css3/_columns.scss @@ -1,47 +1,67 @@ @mixin columns($arg: auto) { + @include _bourbon-deprecate-for-prefixing("columns"); + // || @include prefixer(columns, $arg, webkit moz spec); } @mixin column-count($int: auto) { + @include _bourbon-deprecate-for-prefixing("column-count"); + // auto || integer @include prefixer(column-count, $int, webkit moz spec); } @mixin column-gap($length: normal) { + @include _bourbon-deprecate-for-prefixing("column-gap"); + // normal || length @include prefixer(column-gap, $length, webkit moz spec); } @mixin column-fill($arg: auto) { + @include _bourbon-deprecate-for-prefixing("column-fill"); + // auto || length @include prefixer(column-fill, $arg, webkit moz spec); } @mixin column-rule($arg) { + @include _bourbon-deprecate-for-prefixing("column-rule"); + // || || @include prefixer(column-rule, $arg, webkit moz spec); } @mixin column-rule-color($color) { + @include _bourbon-deprecate-for-prefixing("column-rule-color"); + @include prefixer(column-rule-color, $color, webkit moz spec); } @mixin column-rule-style($style: none) { + @include _bourbon-deprecate-for-prefixing("column-rule-style"); + // none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid @include prefixer(column-rule-style, $style, webkit moz spec); } -@mixin column-rule-width ($width: none) { +@mixin column-rule-width($width: none) { + @include _bourbon-deprecate-for-prefixing("column-rule-width"); + @include prefixer(column-rule-width, $width, webkit moz spec); } @mixin column-span($arg: none) { + @include _bourbon-deprecate-for-prefixing("column-span"); + // none || all @include prefixer(column-span, $arg, webkit moz spec); } @mixin column-width($length: auto) { + @include _bourbon-deprecate-for-prefixing("column-width"); + // auto || length @include prefixer(column-width, $length, webkit moz spec); } diff --git a/app/assets/stylesheets/css3/_filter.scss b/app/assets/stylesheets/css3/_filter.scss index b8f8ffb0e..834756dc6 100644 --- a/app/assets/stylesheets/css3/_filter.scss +++ b/app/assets/stylesheets/css3/_filter.scss @@ -1,4 +1,6 @@ @mixin filter($function: none) { + @include _bourbon-deprecate-for-prefixing("filter"); + // [ @include prefixer(perspective, $depth, webkit moz spec); } @mixin perspective-origin($value: 50% 50%) { + @include _bourbon-deprecate-for-prefixing("perspective-origin"); + @include prefixer(perspective-origin, $value, webkit moz spec); } diff --git a/app/assets/stylesheets/css3/_placeholder.scss b/app/assets/stylesheets/css3/_placeholder.scss index 5682fd097..3ef9d06f7 100644 --- a/app/assets/stylesheets/css3/_placeholder.scss +++ b/app/assets/stylesheets/css3/_placeholder.scss @@ -1,4 +1,6 @@ @mixin placeholder { + @include _bourbon-deprecate-for-prefixing("placeholder"); + $placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input"; @each $placeholder in $placeholders { &:#{$placeholder}-placeholder { diff --git a/app/assets/stylesheets/css3/_radial-gradient.scss b/app/assets/stylesheets/css3/_radial-gradient.scss index 18f7b5b58..cb01c8349 100644 --- a/app/assets/stylesheets/css3/_radial-gradient.scss +++ b/app/assets/stylesheets/css3/_radial-gradient.scss @@ -7,6 +7,7 @@ $pos: null, $shape-size: null, $fallback: null) { + @include _bourbon-deprecate-for-prefixing("radial-gradient"); $data: _radial-arg-parser($g1, $g2, $pos, $shape-size); $g1: nth($data, 1); diff --git a/app/assets/stylesheets/css3/_selection.scss b/app/assets/stylesheets/css3/_selection.scss index cd71d4f53..f27ae088a 100644 --- a/app/assets/stylesheets/css3/_selection.scss +++ b/app/assets/stylesheets/css3/_selection.scss @@ -22,6 +22,8 @@ /// } @mixin selection($current-selector: false) { + @include _bourbon-deprecate-for-prefixing("selection"); + @if $current-selector { &::-moz-selection { @content; diff --git a/app/assets/stylesheets/css3/_text-decoration.scss b/app/assets/stylesheets/css3/_text-decoration.scss index 9222746ce..6a575db43 100644 --- a/app/assets/stylesheets/css3/_text-decoration.scss +++ b/app/assets/stylesheets/css3/_text-decoration.scss @@ -1,19 +1,27 @@ @mixin text-decoration($value) { + @include _bourbon-deprecate-for-prefixing("text-decoration"); + // || || @include prefixer(text-decoration, $value, moz); } @mixin text-decoration-line($line: none) { + @include _bourbon-deprecate-for-prefixing("text-decoration-line"); + // none || underline || overline || line-through @include prefixer(text-decoration-line, $line, moz); } @mixin text-decoration-style($style: solid) { + @include _bourbon-deprecate-for-prefixing("text-decoration-style"); + // solid || double || dotted || dashed || wavy @include prefixer(text-decoration-style, $style, moz webkit); } @mixin text-decoration-color($color: currentColor) { + @include _bourbon-deprecate-for-prefixing("text-decoration-color"); + // currentColor || @include prefixer(text-decoration-color, $color, moz); } diff --git a/app/assets/stylesheets/css3/_transform.scss b/app/assets/stylesheets/css3/_transform.scss index 8ee6509ff..3553c7a80 100644 --- a/app/assets/stylesheets/css3/_transform.scss +++ b/app/assets/stylesheets/css3/_transform.scss @@ -1,9 +1,13 @@ @mixin transform($property: none) { + @include _bourbon-deprecate-for-prefixing("transform"); + // none | @include prefixer(transform, $property, webkit moz ms o spec); } @mixin transform-origin($axes: 50%) { + @include _bourbon-deprecate-for-prefixing("transform-origin"); + // x-axis - left | center | right | length | % // y-axis - top | center | bottom | length | % // z-axis - length @@ -11,5 +15,7 @@ } @mixin transform-style($style: flat) { + @include _bourbon-deprecate-for-prefixing("transform-style"); + @include prefixer(transform-style, $style, webkit moz ms o spec); } diff --git a/app/assets/stylesheets/css3/_transition.scss b/app/assets/stylesheets/css3/_transition.scss index 3c785ed52..8ff3467e4 100644 --- a/app/assets/stylesheets/css3/_transition.scss +++ b/app/assets/stylesheets/css3/_transition.scss @@ -4,6 +4,8 @@ // @include transition-property (transform, opacity); @mixin transition($properties...) { + @include _bourbon-deprecate-for-prefixing("transition"); + // Fix for vendor-prefix transform property $needs-prefixes: false; $webkit: (); @@ -52,20 +54,28 @@ } @mixin transition-property($properties...) { + @include _bourbon-deprecate-for-prefixing("transition-property"); + -webkit-transition-property: transition-property-names($properties, "webkit"); -moz-transition-property: transition-property-names($properties, "moz"); transition-property: transition-property-names($properties, false); } @mixin transition-duration($times...) { + @include _bourbon-deprecate-for-prefixing("transition-duration"); + @include prefixer(transition-duration, $times, webkit moz spec); } @mixin transition-timing-function($motions...) { + @include _bourbon-deprecate-for-prefixing("transition-timing-function"); + // ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier() @include prefixer(transition-timing-function, $motions, webkit moz spec); } @mixin transition-delay($times...) { + @include _bourbon-deprecate-for-prefixing("transition-delay"); + @include prefixer(transition-delay, $times, webkit moz spec); } diff --git a/app/assets/stylesheets/css3/_user-select.scss b/app/assets/stylesheets/css3/_user-select.scss index d4e555100..b262ae4ca 100644 --- a/app/assets/stylesheets/css3/_user-select.scss +++ b/app/assets/stylesheets/css3/_user-select.scss @@ -1,3 +1,5 @@ @mixin user-select($value: none) { + @include _bourbon-deprecate-for-prefixing("user-select"); + @include prefixer(user-select, $value, webkit moz ms spec); } diff --git a/app/assets/stylesheets/functions/_assign-inputs.scss b/app/assets/stylesheets/functions/_assign-inputs.scss index f8aba9678..1ad842036 100644 --- a/app/assets/stylesheets/functions/_assign-inputs.scss +++ b/app/assets/stylesheets/functions/_assign-inputs.scss @@ -1,4 +1,9 @@ @function assign-inputs($inputs, $pseudo: null) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `assign-inputs` is deprecated and will be " + + "removed in 5.0.0."; + } + $list: (); @each $input in $inputs { diff --git a/app/assets/stylesheets/functions/_contains-falsy.scss b/app/assets/stylesheets/functions/_contains-falsy.scss index c096fdb92..d5ab01b90 100644 --- a/app/assets/stylesheets/functions/_contains-falsy.scss +++ b/app/assets/stylesheets/functions/_contains-falsy.scss @@ -10,6 +10,11 @@ /// @return {Bool} @function contains-falsy($list) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `contains-falsy` is deprecated and will be " + + "removed in 5.0.0."; + } + @each $item in $list { @if not $item { @return true; diff --git a/app/assets/stylesheets/functions/_contains.scss b/app/assets/stylesheets/functions/_contains.scss index 3dec27db8..4db1eaf08 100644 --- a/app/assets/stylesheets/functions/_contains.scss +++ b/app/assets/stylesheets/functions/_contains.scss @@ -16,6 +16,11 @@ /// @return {Bool} @function contains($list, $values...) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `contains` is deprecated and will be " + + "removed in 5.0.0."; + } + @each $value in $values { @if type-of(index($list, $value)) != "number" { @return false; diff --git a/app/assets/stylesheets/functions/_is-length.scss b/app/assets/stylesheets/functions/_is-length.scss index 5826e789b..4e1b333ba 100644 --- a/app/assets/stylesheets/functions/_is-length.scss +++ b/app/assets/stylesheets/functions/_is-length.scss @@ -5,6 +5,11 @@ /// @param {String} $value @function is-length($value) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `is-length` is deprecated and will be " + + "removed in 5.0.0."; + } + @return type-of($value) != "null" and (str-slice($value + "", 1, 4) == "calc" or index(auto inherit initial 0, $value) or (type-of($value) == "number" and not(unitless($value)))); diff --git a/app/assets/stylesheets/functions/_is-light.scss b/app/assets/stylesheets/functions/_is-light.scss index 92d90ac3c..0d72867b2 100644 --- a/app/assets/stylesheets/functions/_is-light.scss +++ b/app/assets/stylesheets/functions/_is-light.scss @@ -12,6 +12,11 @@ /// @return {Bool} @function is-light($hex-color) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `is-light` is deprecated and will be " + + "removed in 5.0.0."; + } + $-local-red: red(rgba($hex-color, 1)); $-local-green: green(rgba($hex-color, 1)); $-local-blue: blue(rgba($hex-color, 1)); diff --git a/app/assets/stylesheets/functions/_is-number.scss b/app/assets/stylesheets/functions/_is-number.scss index a64e0bf21..febad3dac 100644 --- a/app/assets/stylesheets/functions/_is-number.scss +++ b/app/assets/stylesheets/functions/_is-number.scss @@ -7,5 +7,10 @@ /// @require {function} contains @function is-number($value) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `is-number` is deprecated and will be " + + "removed in 5.0.0."; + } + @return contains("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" 0 1 2 3 4 5 6 7 8 9, $value); } diff --git a/app/assets/stylesheets/functions/_is-size.scss b/app/assets/stylesheets/functions/_is-size.scss index 661789ab4..529f4ed20 100644 --- a/app/assets/stylesheets/functions/_is-size.scss +++ b/app/assets/stylesheets/functions/_is-size.scss @@ -8,6 +8,11 @@ /// @require {function} is-length @function is-size($value) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `is-size` is deprecated and will be " + + "removed in 5.0.0."; + } + @return is-length($value) or contains("fill" "fit-content" "min-content" "max-content", $value); } diff --git a/app/assets/stylesheets/functions/_px-to-em.scss b/app/assets/stylesheets/functions/_px-to-em.scss index ae81a44ad..f114badfa 100644 --- a/app/assets/stylesheets/functions/_px-to-em.scss +++ b/app/assets/stylesheets/functions/_px-to-em.scss @@ -3,6 +3,11 @@ // if the parent is another value say 24px write em(12, 24) @function em($pxval, $base: $em-base) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `em` is deprecated and will be " + + "removed in 5.0.0."; + } + @if not unitless($pxval) { $pxval: strip-units($pxval); } diff --git a/app/assets/stylesheets/functions/_px-to-rem.scss b/app/assets/stylesheets/functions/_px-to-rem.scss index 0ac941e76..6d2e14ec2 100644 --- a/app/assets/stylesheets/functions/_px-to-rem.scss +++ b/app/assets/stylesheets/functions/_px-to-rem.scss @@ -3,6 +3,11 @@ // Assumes $em-base is the font-size of @function rem($pxval) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `rem` is deprecated and will be " + + "removed in 5.0.0."; + } + @if not unitless($pxval) { $pxval: strip-units($pxval); } diff --git a/app/assets/stylesheets/functions/_strip-units.scss b/app/assets/stylesheets/functions/_strip-units.scss index 6c5f3e810..5906b410d 100644 --- a/app/assets/stylesheets/functions/_strip-units.scss +++ b/app/assets/stylesheets/functions/_strip-units.scss @@ -13,5 +13,10 @@ /// @return {Number (Unitless)} @function strip-units($value) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `strip-units` is deprecated and will be " + + "removed in 5.0.0. Use the renamed `strip-unit` function instead."; + } + @return ($value / ($value * 0 + 1)); } diff --git a/app/assets/stylesheets/functions/_transition-property-name.scss b/app/assets/stylesheets/functions/_transition-property-name.scss index 18348b93a..25ffcb16c 100644 --- a/app/assets/stylesheets/functions/_transition-property-name.scss +++ b/app/assets/stylesheets/functions/_transition-property-name.scss @@ -2,6 +2,11 @@ // Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background //************************************************************************// @function transition-property-names($props, $vendor: false) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `transition-property-names` is deprecated " + + "and will be removed in 5.0.0."; + } + $new-props: (); @each $prop in $props { @@ -12,6 +17,11 @@ } @function transition-property-name($prop, $vendor: false) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `transition-property-name` is deprecated " + + "and will be removed in 5.0.0."; + } + // put other properties that need to be prefixed here aswell @if $vendor and $prop == transform { @return unquote('-'+$vendor+'-'+$prop); diff --git a/app/assets/stylesheets/functions/_unpack.scss b/app/assets/stylesheets/functions/_unpack.scss index 4367935d5..e8cea40f8 100644 --- a/app/assets/stylesheets/functions/_unpack.scss +++ b/app/assets/stylesheets/functions/_unpack.scss @@ -15,6 +15,11 @@ /// } @function unpack($shorthand) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `unpack` is deprecated and will be " + + "removed in 5.0.0."; + } + @if length($shorthand) == 1 { @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1); } @else if length($shorthand) == 2 { diff --git a/app/assets/stylesheets/helpers/_convert-units.scss b/app/assets/stylesheets/helpers/_convert-units.scss index e0a65a05c..8b11f7119 100644 --- a/app/assets/stylesheets/helpers/_convert-units.scss +++ b/app/assets/stylesheets/helpers/_convert-units.scss @@ -3,6 +3,11 @@ // Source: http://sassmeister.com/gist/9647408 //************************************************************************// @function _convert-units($number, $unit) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_convert-units` is deprecated and will " + + "be removed in 5.0.0."; + } + $strings: "px", "cm", "mm", "%", "ch", "pica", "in", "em", "rem", "pt", "pc", "ex", "vw", "vh", "vmin", "vmax", "deg", "rad", "grad", "turn"; $units: 1px, 1cm, 1mm, 1%, 1ch, 1pica, 1in, 1em, 1rem, 1pt, 1pc, 1ex, 1vw, 1vh, 1vmin, 1vmax, 1deg, 1rad, 1grad, 1turn; $index: index($strings, $unit); diff --git a/app/assets/stylesheets/helpers/_directional-values.scss b/app/assets/stylesheets/helpers/_directional-values.scss index 6ee538db4..a51325dd4 100644 --- a/app/assets/stylesheets/helpers/_directional-values.scss +++ b/app/assets/stylesheets/helpers/_directional-values.scss @@ -27,6 +27,11 @@ /// @return {List} @function collapse-directionals($vals) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `collapse-directionals` is deprecated and " + + "will be removed in 5.0.0."; + } + $output: null; $a: nth($vals, 1); @@ -62,6 +67,8 @@ /// @require {function} contains-falsy @mixin directional-property($pre, $suf, $vals) { + @include _bourbon-deprecate("directional-property"); + // Property Names $top: $pre + "-top" + if($suf, "-#{$suf}", ""); $bottom: $pre + "-bottom" + if($suf, "-#{$suf}", ""); diff --git a/app/assets/stylesheets/helpers/_font-source-declaration.scss b/app/assets/stylesheets/helpers/_font-source-declaration.scss index 7f17586c9..18b381e69 100644 --- a/app/assets/stylesheets/helpers/_font-source-declaration.scss +++ b/app/assets/stylesheets/helpers/_font-source-declaration.scss @@ -2,6 +2,11 @@ // Reference: http://goo.gl/Ru1bKP @function font-url-prefixer($asset-pipeline) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `font-url-prefixer` is deprecated and " + + "will be removed in 5.0.0."; + } + @if $asset-pipeline == true { @return font-url; } @else { @@ -16,6 +21,11 @@ $file-formats, $font-url) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `font-source-declaration` is deprecated " + + "and will be removed in 5.0.0."; + } + $src: (); $formats-map: ( diff --git a/app/assets/stylesheets/helpers/_gradient-positions-parser.scss b/app/assets/stylesheets/helpers/_gradient-positions-parser.scss index 07d30b6cf..134a73eb1 100644 --- a/app/assets/stylesheets/helpers/_gradient-positions-parser.scss +++ b/app/assets/stylesheets/helpers/_gradient-positions-parser.scss @@ -1,4 +1,9 @@ @function _gradient-positions-parser($gradient-type, $gradient-positions) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_gradient-positions-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + @if $gradient-positions and ($gradient-type == linear) and (type-of($gradient-positions) != color) { diff --git a/app/assets/stylesheets/helpers/_linear-angle-parser.scss b/app/assets/stylesheets/helpers/_linear-angle-parser.scss index e0401ed8d..3d259e385 100644 --- a/app/assets/stylesheets/helpers/_linear-angle-parser.scss +++ b/app/assets/stylesheets/helpers/_linear-angle-parser.scss @@ -1,5 +1,10 @@ // Private function for linear-gradient-parser @function _linear-angle-parser($image, $first-val, $prefix, $suffix) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_linear-angle-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $offset: null; $unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val)); $unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val)); diff --git a/app/assets/stylesheets/helpers/_linear-gradient-parser.scss b/app/assets/stylesheets/helpers/_linear-gradient-parser.scss index 48a8f77f9..fa11bbfa4 100644 --- a/app/assets/stylesheets/helpers/_linear-gradient-parser.scss +++ b/app/assets/stylesheets/helpers/_linear-gradient-parser.scss @@ -1,4 +1,9 @@ @function _linear-gradient-parser($image) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_linear-gradient-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $image: unquote($image); $gradients: (); $start: str-index($image, "("); diff --git a/app/assets/stylesheets/helpers/_linear-positions-parser.scss b/app/assets/stylesheets/helpers/_linear-positions-parser.scss index 96d6a6d45..8c3eab2cd 100644 --- a/app/assets/stylesheets/helpers/_linear-positions-parser.scss +++ b/app/assets/stylesheets/helpers/_linear-positions-parser.scss @@ -1,4 +1,9 @@ @function _linear-positions-parser($pos) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_linear-positions-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $type: type-of(nth($pos, 1)); $spec: null; $degree: null; @@ -54,6 +59,11 @@ } @function _position-flipper($pos) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_position-flipper` is " + + "deprecated and will be removed in 5.0.0."; + } + @return if($pos == left, right, null) if($pos == right, left, null) if($pos == top, bottom, null) diff --git a/app/assets/stylesheets/helpers/_linear-side-corner-parser.scss b/app/assets/stylesheets/helpers/_linear-side-corner-parser.scss index 7a691253d..eb0330e71 100644 --- a/app/assets/stylesheets/helpers/_linear-side-corner-parser.scss +++ b/app/assets/stylesheets/helpers/_linear-side-corner-parser.scss @@ -1,5 +1,10 @@ // Private function for linear-gradient-parser @function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_linear-side-corner-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $val-1: str-slice($first-val, 1, $has-multiple-vals - 1); $val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val)); $val-3: null; diff --git a/app/assets/stylesheets/helpers/_radial-arg-parser.scss b/app/assets/stylesheets/helpers/_radial-arg-parser.scss index 56c6030b7..866ee2118 100644 --- a/app/assets/stylesheets/helpers/_radial-arg-parser.scss +++ b/app/assets/stylesheets/helpers/_radial-arg-parser.scss @@ -1,4 +1,9 @@ @function _radial-arg-parser($g1, $g2, $pos, $shape-size) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_radial-arg-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + @each $value in $g1, $g2 { $first-val: nth($value, 1); $pos-type: type-of($first-val); diff --git a/app/assets/stylesheets/helpers/_radial-gradient-parser.scss b/app/assets/stylesheets/helpers/_radial-gradient-parser.scss index 5444d8085..871869b6d 100644 --- a/app/assets/stylesheets/helpers/_radial-gradient-parser.scss +++ b/app/assets/stylesheets/helpers/_radial-gradient-parser.scss @@ -1,4 +1,9 @@ @function _radial-gradient-parser($image) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_radial-gradient-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $image: unquote($image); $gradients: (); $start: str-index($image, "("); diff --git a/app/assets/stylesheets/helpers/_radial-positions-parser.scss b/app/assets/stylesheets/helpers/_radial-positions-parser.scss index 3c552ad79..bc24790ae 100644 --- a/app/assets/stylesheets/helpers/_radial-positions-parser.scss +++ b/app/assets/stylesheets/helpers/_radial-positions-parser.scss @@ -1,4 +1,9 @@ @function _radial-positions-parser($gradient-pos) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_radial-positions-parser` is " + + "deprecated and will be removed in 5.0.0."; + } + $shape-size: nth($gradient-pos, 1); $pos: nth($gradient-pos, 2); $shape-size-spec: _shape-size-stripper($shape-size); diff --git a/app/assets/stylesheets/helpers/_render-gradients.scss b/app/assets/stylesheets/helpers/_render-gradients.scss index 576567683..ec9fc37e9 100644 --- a/app/assets/stylesheets/helpers/_render-gradients.scss +++ b/app/assets/stylesheets/helpers/_render-gradients.scss @@ -1,6 +1,11 @@ // User for linear and radial gradients within background-image or border-image properties @function _render-gradients($gradient-positions, $gradients, $gradient-type, $vendor: false) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_render-gradients` is " + + "deprecated and will be removed in 5.0.0."; + } + $pre-spec: null; $spec: null; $vendor-gradients: null; diff --git a/app/assets/stylesheets/helpers/_shape-size-stripper.scss b/app/assets/stylesheets/helpers/_shape-size-stripper.scss index ee5eda422..6caf05caf 100644 --- a/app/assets/stylesheets/helpers/_shape-size-stripper.scss +++ b/app/assets/stylesheets/helpers/_shape-size-stripper.scss @@ -1,4 +1,9 @@ @function _shape-size-stripper($shape-size) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_shape-size-stripper` is " + + "deprecated and will be removed in 5.0.0."; + } + $shape-size-spec: null; @each $value in $shape-size { @if ($value == "cover") or ($value == "contain") { diff --git a/app/assets/stylesheets/helpers/_str-to-num.scss b/app/assets/stylesheets/helpers/_str-to-num.scss index 3ef1d873b..1e039f25d 100644 --- a/app/assets/stylesheets/helpers/_str-to-num.scss +++ b/app/assets/stylesheets/helpers/_str-to-num.scss @@ -3,6 +3,11 @@ // Source: http://sassmeister.com/gist/9647408 //************************************************************************// @function _str-to-num($string) { + @if $output-bourbon-deprecation-warnings == true { + @warn "[Bourbon] [Deprecation] `_str-to-num` is " + + "deprecated and will be removed in 5.0.0."; + } + // Matrices $strings: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"; $numbers: 0 1 2 3 4 5 6 7 8 9; diff --git a/app/assets/stylesheets/settings/_deprecation-warnings.scss b/app/assets/stylesheets/settings/_deprecation-warnings.scss new file mode 100644 index 000000000..65e467054 --- /dev/null +++ b/app/assets/stylesheets/settings/_deprecation-warnings.scss @@ -0,0 +1,8 @@ +@charset "UTF-8"; + +/// Enable or disable output of Bourbon’s deprecation-related Sass warnings. +/// This variable must be declared _before_ importing Bourbon. +/// +/// @type Bool + +$output-bourbon-deprecation-warnings: true !default; diff --git a/bower.json b/bower.json index 7dfc9ca85..c28e20266 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bourbon", "description": "A simple and lightweight mixin library for Sass.", - "version": "4.2.7", + "version": "4.3.0", "main": "app/assets/stylesheets/_bourbon.scss", "license": "MIT", "ignore": [ diff --git a/circle.yml b/circle.yml new file mode 100644 index 000000000..bff881bfd --- /dev/null +++ b/circle.yml @@ -0,0 +1,10 @@ +general: + branches: + ignore: + - gh-pages +machine: + ruby: + version: 2.3.0 +test: + override: + - bundle exec rake diff --git a/lib/bourbon/version.rb b/lib/bourbon/version.rb index 90f00b134..d058a3b2c 100644 --- a/lib/bourbon/version.rb +++ b/lib/bourbon/version.rb @@ -1,3 +1,3 @@ module Bourbon - VERSION = "4.2.7" + VERSION = "4.3.0" end diff --git a/package.json b/package.json index 2d67e2753..2b4995ead 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bourbon", - "version": "4.2.7", + "version": "4.3.0", "description": "A simple and lightweight mixin library for Sass.", "keywords": [ "css",