Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warnings #891

Merged
merged 2 commits into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/assets/stylesheets/_bourbon-deprecate.scss
Original file line number Diff line number Diff line change
@@ -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.");
}
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);
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/_bourbon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
// Copyright 2011-2015 thoughtbot, inc.
// MIT License

@import "settings/disable-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";
Expand Down
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