_mixins.scss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* stylelint-disable property-no-vendor-prefix */
  2. /* FUNCTIONS */
  3. //animation
  4. @mixin transition($target, $duration, $ease) {
  5. -webkit-transition: $target $duration $ease;
  6. -moz-transition: $target $duration $ease;
  7. -o-transition: $target $duration $ease;
  8. -ms-transition: $target $duration $ease;
  9. transition: $target $duration $ease;
  10. }
  11. //animation
  12. @mixin animation-delay($delay) {
  13. -webkit-animation-delay: $delay;
  14. /* Safari 4.0 - 8.0 */
  15. animation-delay: $delay;
  16. }
  17. //animation
  18. @mixin animation($animate...) {
  19. $max: length($animate);
  20. $animations: '';
  21. @for $i from 1 through $max {
  22. $animations: #{$animations + nth($animate, $i)};
  23. @if $i < $max {
  24. $animations: #{$animations + ", "};
  25. }
  26. }
  27. -webkit-animation: $animations;
  28. -moz-animation: $animations;
  29. -o-animation: $animations;
  30. -ms-transition: $animations;
  31. animation: $animations;
  32. }
  33. //keyframes
  34. @mixin keyframes($animationName) {
  35. @-webkit-keyframes #{$animationName} {
  36. @content;
  37. }
  38. @-moz-keyframes #{$animationName} {
  39. @content;
  40. }
  41. @-o-keyframes #{$animationName} {
  42. @content;
  43. }
  44. @keyframes #{$animationName} {
  45. @content;
  46. }
  47. }
  48. @mixin border-radius($radius: 4px) {
  49. -moz-border-radius: $radius;
  50. -webkit-border-radius: $radius;
  51. -ms-border-radius: $radius;
  52. -o-border-radius: $radius;
  53. -khtml-border-radius: $radius;
  54. border-radius: $radius;
  55. }