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.

149 lines
3.1 KiB

  1. /**
  2. * Placeholder attribute for inputs
  3. *
  4. * @return {string} Placeholder attributes
  5. */
  6. @mixin placeholder {
  7. &::-webkit-input-placeholder {@content};
  8. &::-moz-placeholder {@content}
  9. &:-ms-input-placeholder {@content}
  10. &:placeholder-shown {@content};
  11. }
  12. /**
  13. * Spinner element
  14. *
  15. * @param {string} $color - Color
  16. * @param {string} $dur - Animation Duration
  17. * @param {int} $width - Width
  18. * @param {int} $height [$width] - height
  19. *
  20. * @return {string} Spinner element
  21. */
  22. @mixin spinner($color,$dur,$width,$height:$width) {
  23. width: $width;
  24. height: $height;
  25. border-radius: 50%;
  26. box-shadow:0 0 0 1px rgba(0,0,0,0.1), 2px 1px 0 $color;
  27. @include prefix(animation, spin $dur linear infinite);
  28. @include keyframes(spin) {
  29. 100%{
  30. @include prefix(transform, rotate(360deg));
  31. }
  32. };
  33. }
  34. /**
  35. * Prefixes for keyframes
  36. *
  37. * @param {string} $animation-name - The animation name
  38. *
  39. * @return {string} Prefixed keyframes attributes
  40. */
  41. @mixin keyframes($animation-name) {
  42. @-webkit-keyframes #{$animation-name} {
  43. @content;
  44. }
  45. @-moz-keyframes #{$animation-name} {
  46. @content;
  47. }
  48. @-o-keyframes #{$animation-name} {
  49. @content;
  50. }
  51. @keyframes #{$animation-name} {
  52. @content;
  53. }
  54. }
  55. /**
  56. * Prefix function for browser compatibility
  57. *
  58. * @param {string} $property - Property name
  59. * @param {any} $value - Property value
  60. *
  61. * @return {string} Prefixed attributes
  62. */
  63. @mixin prefix($property, $value) {
  64. -webkit-#{$property}: #{$value};
  65. -moz-#{$property}: #{$value};
  66. -ms-#{$property}: #{$value};
  67. -o-#{$property}: #{$value};
  68. #{$property}: #{$value};
  69. }
  70. /**
  71. * Layout Mixins
  72. */
  73. @mixin from($device) {
  74. @media screen and (min-width: $device) {
  75. @content;
  76. }
  77. }
  78. @mixin until($device) {
  79. @media screen and (max-width: $device - 1px) {
  80. @content;
  81. }
  82. }
  83. @mixin mobile {
  84. @media screen and (max-width: $tablet - 1px) {
  85. @content;
  86. }
  87. }
  88. @mixin tablet {
  89. @media screen and (min-width: $tablet) {
  90. @content;
  91. }
  92. }
  93. @mixin tablet-only {
  94. @media screen and (min-width: $tablet) and (max-width: $desktop - 1px) {
  95. @content;
  96. }
  97. }
  98. @mixin touch {
  99. @media screen and (max-width: $desktop - 1px) {
  100. @content;
  101. }
  102. }
  103. @mixin desktop {
  104. @media screen and (min-width: $desktop) {
  105. @content;
  106. }
  107. }
  108. @mixin desktop-only {
  109. @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px) {
  110. @content;
  111. }
  112. }
  113. @mixin widescreen {
  114. @media screen and (min-width: $widescreen) {
  115. @content;
  116. }
  117. }
  118. // Nucleo Icons
  119. @mixin nc-rotate($degrees, $rotation) {
  120. filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
  121. -webkit-transform: rotate($degrees);
  122. -moz-transform: rotate($degrees);
  123. -ms-transform: rotate($degrees);
  124. -o-transform: rotate($degrees);
  125. transform: rotate($degrees);
  126. }
  127. @mixin nc-flip($horiz, $vert, $rotation) {
  128. filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
  129. -webkit-transform: scale($horiz, $vert);
  130. -moz-transform: scale($horiz, $vert);
  131. -ms-transform: scale($horiz, $vert);
  132. -o-transform: scale($horiz, $vert);
  133. transform: scale($horiz, $vert);
  134. }