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.

84 lines
1.9 KiB

  1. /**
  2. * Clearfix
  3. *
  4. * @return {string} Clearfix attribute
  5. */
  6. @mixin clearfix {
  7. &:after {
  8. content: "";
  9. display: table;
  10. clear: both;
  11. }
  12. }
  13. /**
  14. * Placeholder attribute for inputs
  15. *
  16. * @return {string} Placeholder attributes
  17. */
  18. @mixin placeholder {
  19. &::-webkit-input-placeholder {@content};
  20. &::-moz-placeholder {@content}
  21. &:-ms-input-placeholder {@content}
  22. &:placeholder-shown {@content};
  23. }
  24. /**
  25. * Spinner element
  26. *
  27. * @param {string} $color - Color
  28. * @param {string} $dur - Animation Duration
  29. * @param {int} $width - Width
  30. * @param {int} $height [$width] - height
  31. *
  32. * @return {string} Spinner element
  33. */
  34. @mixin spinner($color,$dur,$width,$height:$width) {
  35. width: $width;
  36. height: $height;
  37. border-radius: 50%;
  38. box-shadow:0 0 0 1px rgba(0,0,0,0.1), 2px 1px 0 $color;
  39. @include prefix(animation, spin $dur linear infinite);
  40. @include keyframes(spin) {
  41. 100%{
  42. @include prefix(transform, rotate(360deg));
  43. }
  44. };
  45. }
  46. /**
  47. * Prefixes for keyframes
  48. *
  49. * @param {string} $animation-name - The animation name
  50. *
  51. * @return {string} Prefixed keyframes attributes
  52. */
  53. @mixin keyframes($animation-name) {
  54. @-webkit-keyframes #{$animation-name} {
  55. @content;
  56. }
  57. @-moz-keyframes #{$animation-name} {
  58. @content;
  59. }
  60. @-o-keyframes #{$animation-name} {
  61. @content;
  62. }
  63. @keyframes #{$animation-name} {
  64. @content;
  65. }
  66. }
  67. /**
  68. * Prefix function for browser compatibility
  69. *
  70. * @param {string} $property - Property name
  71. * @param {any} $value - Property value
  72. *
  73. * @return {string} Prefixed attributes
  74. */
  75. @mixin prefix($property, $value) {
  76. -webkit-#{$property}: #{$value};
  77. -moz-#{$property}: #{$value};
  78. -ms-#{$property}: #{$value};
  79. -o-#{$property}: #{$value};
  80. #{$property}: #{$value};
  81. }