Skip to content

Commit

Permalink
Add deprecation warnings
Browse files Browse the repository at this point in the history
Add deprecation warnings for features that will be removed or changed in 5.0.0.

For more information on why most of these features are being removed, see:
#702
  • Loading branch information
tysongach authored and Tyson Gach committed May 20, 2016
1 parent 094480b commit fc9d1ee
Show file tree
Hide file tree
Showing 53 changed files with 318 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/_bourbon-deprecate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
@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}.";
"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");
"prefixing tool, like Autoprefixer.");
}
42 changes: 28 additions & 14 deletions app/assets/stylesheets/_bourbon-deprecated-upcoming.scss
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/addons/_retina-image.scss
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
18 changes: 18 additions & 0 deletions app/assets/stylesheets/css3/_animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <number>
@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);
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_appearance.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@mixin appearance($value) {
@include _bourbon-deprecate-for-prefixing("appearance");

@include prefixer(appearance, $value, webkit moz ms o spec);
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_backface-visibility.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@mixin backface-visibility($visibility) {
@include _bourbon-deprecate-for-prefixing("backface-visibility");

@include prefixer(backface-visibility, $visibility, webkit spec);
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_background-image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//************************************************************************//

@mixin background-image($images...) {
@include _bourbon-deprecate-for-prefixing("background-image");

$webkit-images: ();
$spec-images: ();

Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//************************************************************************//

@mixin background($backgrounds...) {
@include _bourbon-deprecate-for-prefixing("background");

$webkit-backgrounds: ();
$spec-backgrounds: ();

Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_border-image.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@mixin border-image($borders...) {
@include _bourbon-deprecate-for-prefixing("border-image");

$webkit-borders: ();
$spec-borders: ();

Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_calc.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@mixin calc($property, $value) {
@include _bourbon-deprecate-for-prefixing("calc");

#{$property}: -webkit-calc(#{$value});
#{$property}: calc(#{$value});
}
22 changes: 21 additions & 1 deletion app/assets/stylesheets/css3/_columns.scss
Original file line number Diff line number Diff line change
@@ -1,47 +1,67 @@
@mixin columns($arg: auto) {
@include _bourbon-deprecate-for-prefixing("columns");

// <column-count> || <column-width>
@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");

// <border-width> || <border-style> || <color>
@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);
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/css3/_filter.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@mixin filter($function: none) {
@include _bourbon-deprecate-for-prefixing("filter");

// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit spec);
}
Loading

0 comments on commit fc9d1ee

Please sign in to comment.