You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_mixins.scss 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * Animation mixin.
  3. */
  4. @mixin animation($animate...) {
  5. $max: length($animate);
  6. $animations: '';
  7. @for $i from 1 through $max {
  8. $animations: #{$animations + nth($animate, $i)};
  9. @if $i < $max {
  10. $animations: #{$animations + ", "};
  11. }
  12. }
  13. -webkit-animation: $animations;
  14. -moz-animation: $animations;
  15. -o-animation: $animations;
  16. animation: $animations;
  17. }
  18. @mixin flex() {
  19. display: -webkit-box;
  20. display: -moz-box;
  21. display: -ms-flexbox;
  22. display: -webkit-flex;
  23. display: flex;
  24. }
  25. /**
  26. * Keyframes mixin.
  27. */
  28. @mixin keyframes($animationName) {
  29. @-webkit-keyframes #{$animationName} {
  30. @content;
  31. }
  32. @-moz-keyframes #{$animationName} {
  33. @content;
  34. }
  35. @-o-keyframes #{$animationName} {
  36. @content;
  37. }
  38. @keyframes #{$animationName} {
  39. @content;
  40. }
  41. }
  42. @mixin circle($diameter) {
  43. width: $diameter;
  44. height: $diameter;
  45. border-radius: 50%;
  46. }
  47. @mixin absoluteAligning($sizeX, $sizeY) {
  48. top: 50%;
  49. left: 50%;
  50. position: absolute;
  51. @include transform(translate(-#{$sizeX / 2}, -#{$sizeY / 2}))
  52. }
  53. @mixin transform($func) {
  54. -moz-transform: $func;
  55. -ms-transform: $func;
  56. -webkit-transform: $func;
  57. -o-transform: $func;
  58. transform: $func;
  59. }
  60. @mixin transition($transition...) {
  61. -moz-transition: $transition;
  62. -o-transition: $transition;
  63. -webkit-transition: $transition;
  64. transition: $transition;
  65. }
  66. @mixin box-shadow($type, $h, $y, $blur, $color) {
  67. -webkit-box-shadow: $type $h $y $blur $color;
  68. -moz-box-shadow: $type $h $y $blur $color;
  69. box-shadow: $type $h $y $blur $color;
  70. }