1
0
mirror of https://github.com/danog/2048.git synced 2024-12-11 08:50:53 +01:00
2048/style/helpers.scss

63 lines
1.3 KiB
SCSS
Raw Normal View History

2014-03-05 16:15:11 +01:00
// Exponent
// From: https://github.com/Team-Sass/Sassy-math/blob/master/sass/math.scss#L36
@function exponent($base, $exponent) {
// reset value
$value: $base;
// positive intergers get multiplied
@if $exponent > 1 {
@for $i from 2 through $exponent {
$value: $value * $base; } }
// negitive intergers get divided. A number divided by itself is 1
@if $exponent < 1 {
@for $i from 0 through -$exponent {
$value: $value / $base; } }
// return the last value written
@return $value;
}
@function pow($base, $exponent) {
@return exponent($base, $exponent);
}
// Transition mixins
@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
}
@mixin transition-property($args...) {
-webkit-transition-property: $args;
-moz-transition-property: $args;
}
2014-03-09 14:32:30 +01:00
// Keyframe animations
@mixin keyframes($animation-name) {
@-webkit-keyframes $animation-name {
@content;
}
@-moz-keyframes $animation-name {
@content;
}
@keyframes $animation-name {
@content;
}
}
@mixin animation($str) {
-webkit-animation: #{$str};
-moz-animation: #{$str};
}
@mixin animation-fill-mode($str) {
-webkit-animation-fill-mode: #{$str};
-moz-animation-fill-mode: #{$str};
}
2014-03-10 21:31:41 +01:00
// Media queries
@mixin smaller($width) {
@media screen and (max-width: $width) {
@content;
}
}