Skip to content

Commit

Permalink
Revert back to old prefixer
Browse files Browse the repository at this point in the history
This was a breaking change and we can't offer a fallback. We can update the prefixer when we move to v5.0.0
  • Loading branch information
Tyson Gach committed Jan 29, 2015
1 parent 7524326 commit a15f0a4
Show file tree
Hide file tree
Showing 17 changed files with 168 additions and 179 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/_bourbon-deprecated-upcoming.scss
Expand Up @@ -405,8 +405,7 @@
}

@mixin box-sizing($box) {
// content-box | border-box | inherit
@include prefixer(box-sizing, $box, webkit moz);
@include prefixer(box-sizing, $box, webkit moz spec);

@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.";
}
44 changes: 35 additions & 9 deletions app/assets/stylesheets/addons/_prefixer.scss
Expand Up @@ -23,18 +23,44 @@
/// border-radius: 10px;
/// }
///
/// @require {variable} $global-prefixes
/// @require {variable} $prefix-for-webkit
/// @require {variable} $prefix-for-mozilla
/// @require {variable} $prefix-for-microsoft
/// @require {variable} $prefix-for-opera
/// @require {variable} $prefix-for-spec

@mixin prefixer($property, $value, $prefixes: ()) {
@mixin prefixer($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if not map-has-key($global-prefixes, $prefix) {
@warn "Unrecognized prefix: `#{$prefix}`.";
}

@if map-get($global-prefixes, $prefix) {
#{"-" + $prefix + "-" + $property}: $value;
@if $prefix == webkit {
@if $prefix-for-webkit {
-webkit-#{$property}: $value;
}
} @else if $prefix == moz {
@if $prefix-for-mozilla {
-moz-#{$property}: $value;
}
} @else if $prefix == ms {
@if $prefix-for-microsoft {
-ms-#{$property}: $value;
}
} @else if $prefix == o {
@if $prefix-for-opera {
-o-#{$property}: $value;
}
} @else if $prefix == spec {
@if $prefix-for-spec {
#{$property}: $value;
}
} @else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}

#{$property}: $value;
@mixin disable-prefix-for-all() {
$prefix-for-webkit: false !global;
$prefix-for-mozilla: false !global;
$prefix-for-microsoft: false !global;
$prefix-for-opera: false !global;
$prefix-for-spec: false !global;
}
28 changes: 14 additions & 14 deletions app/assets/stylesheets/css3/_animation.scss
Expand Up @@ -2,42 +2,42 @@
// 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 prefixer(animation, $animations, webkit moz);
@include prefixer(animation, $animations, webkit moz spec);
}

@mixin animation-name($names...) {
@include prefixer(animation-name, $names, webkit moz);
@include prefixer(animation-name, $names, webkit moz spec);
}

@mixin animation-duration($times...) {
@include prefixer(animation-duration, $times, webkit moz);
@include prefixer(animation-duration, $times, webkit moz spec);
}

@mixin animation-timing-function($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out
@include prefixer(animation-timing-function, $motions, webkit moz);
// ease | linear | ease-in | ease-out | ease-in-out
@include prefixer(animation-timing-function, $motions, webkit moz spec);
}

@mixin animation-iteration-count($values...) {
// infinite | <number>
@include prefixer(animation-iteration-count, $values, webkit moz);
// infinite | <number>
@include prefixer(animation-iteration-count, $values, webkit moz spec);
}

@mixin animation-direction($directions...) {
// normal | alternate
@include prefixer(animation-direction, $directions, webkit moz);
// normal | alternate
@include prefixer(animation-direction, $directions, webkit moz spec);
}

@mixin animation-play-state($states...) {
// running | paused
@include prefixer(animation-play-state, $states, webkit moz);
// running | paused
@include prefixer(animation-play-state, $states, webkit moz spec);
}

@mixin animation-delay($times...) {
@include prefixer(animation-delay, $times, webkit moz);
@include prefixer(animation-delay, $times, webkit moz spec);
}

@mixin animation-fill-mode($modes...) {
// none | forwards | backwards | both
@include prefixer(animation-fill-mode, $modes, webkit moz);
// none | forwards | backwards | both
@include prefixer(animation-fill-mode, $modes, webkit moz spec);
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/css3/_appearance.scss
@@ -1,3 +1,3 @@
@mixin appearance($value) {
@include prefixer(appearance, $value, webkit moz ms o);
@include prefixer(appearance, $value, webkit moz ms o spec);
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/css3/_backface-visibility.scss
@@ -1,3 +1,3 @@
@mixin backface-visibility($visibility) {
@include prefixer(backface-visibility, $visibility, webkit);
@include prefixer(backface-visibility, $visibility, webkit spec);
}
4 changes: 1 addition & 3 deletions app/assets/stylesheets/css3/_calc.scss
@@ -1,6 +1,4 @@
@mixin calc($property, $value) {
@if map-get($prefixes, webkit) {
#{$property}: -webkit-calc(#{$value});
}
#{$property}: -webkit-calc(#{$value});
#{$property}: calc(#{$value});
}
36 changes: 18 additions & 18 deletions app/assets/stylesheets/css3/_columns.scss
@@ -1,47 +1,47 @@
@mixin columns($arg: auto) {
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz);
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz spec);
}

@mixin column-count($int: auto) {
// auto || integer
@include prefixer(column-count, $int, webkit moz);
// auto || integer
@include prefixer(column-count, $int, webkit moz spec);
}

@mixin column-gap($length: normal) {
// normal || length
@include prefixer(column-gap, $length, webkit moz);
// normal || length
@include prefixer(column-gap, $length, webkit moz spec);
}

@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(column-fill, $arg, webkit moz);
// auto || length
@include prefixer(column-fill, $arg, webkit moz spec);
}

@mixin column-rule($arg) {
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz);
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz spec);
}

@mixin column-rule-color($color) {
@include prefixer(column-rule-color, $color, webkit moz);
@include prefixer(column-rule-color, $color, webkit moz spec);
}

@mixin column-rule-style($style: none) {
// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid
@include prefixer(column-rule-style, $style, webkit moz);
// 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) {
@include prefixer(column-rule-width, $width, webkit moz);
@include prefixer(column-rule-width, $width, webkit moz spec);
}

@mixin column-span($arg: none) {
// none || all
@include prefixer(column-span, $arg, webkit moz);
// none || all
@include prefixer(column-span, $arg, webkit moz spec);
}

@mixin column-width($length: auto) {
// auto || length
@include prefixer(column-width, $length, webkit moz);
// auto || length
@include prefixer(column-width, $length, webkit moz spec);
}
5 changes: 2 additions & 3 deletions app/assets/stylesheets/css3/_filter.scss
@@ -1,5 +1,4 @@
@mixin filter($function: none) {
// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit);
// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit spec);
}

0 comments on commit a15f0a4

Please sign in to comment.