Skip to content

Commit

Permalink
Merge pull request #66 from levtolstoi/master
Browse files Browse the repository at this point in the history
add viewport-unit mixin to examples
  • Loading branch information
rodneyrehm committed Mar 10, 2016
2 parents 933cf2e + 33e178d commit ce080f0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions examples/sass/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/* From https://coderwall.com/p/qac-og */

@mixin calc($property, $expression, $x:"") {


#{$property}: -moz-calc(#{$expression}) #{$x};
#{$property}: -webkit-calc(#{$expression}) #{$x};
#{$property}: calc(#{$expression}) #{$x};
}
}

// Mixin for simple using viewport units with buggyfill
// Example include: @include viewport-unit((width: 23.5vw, height: 32vw, background-position: -47.8vw top));
// Its work!)

@mixin viewport-unit($prop-value){
$str:;
@each $prop, $value in $prop-value {
#{$prop}: #{$value};
$str: "#{$str} #{$prop}: #{$value};"
}
content: "viewport-units-buggyfill; #{$str}";
}

0 comments on commit ce080f0

Please sign in to comment.