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.

175 lines
5.0 KiB

4 years ago
  1. @mixin text-shadow ($string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
  2. text-shadow: $string;
  3. }
  4. @mixin box-shadow ($string) {
  5. -webkit-box-shadow: $string;
  6. -moz-box-shadow: $string;
  7. box-shadow: $string;
  8. }
  9. @mixin box-sizing ($type: border-box) {
  10. -webkit-box-sizing: $type;
  11. -moz-box-sizing: $type;
  12. box-sizing: $type;
  13. }
  14. @mixin border-radius ($radius: 5px) {
  15. -webkit-border-radius: $radius;
  16. -moz-border-radius: $radius;
  17. -ms-border-radius: $radius;
  18. -o-border-radius: $radius;
  19. border-radius: $radius;
  20. -moz-background-clip: padding;
  21. -webkit-background-clip: padding-box;
  22. background-clip: padding-box;
  23. }
  24. @mixin border-radiuses ($topright: 0, $bottomright: 0, $bottomleft: 0, $topleft: 0) {
  25. -webkit-border-top-right-radius: $topright;
  26. -webkit-border-bottom-right-radius: $bottomright;
  27. -webkit-border-bottom-left-radius: $bottomleft;
  28. -webkit-border-top-left-radius: $topleft;
  29. -moz-border-radius-topright: $topright;
  30. -moz-border-radius-bottomright: $bottomright;
  31. -moz-border-radius-bottomleft: $bottomleft;
  32. -moz-border-radius-topleft: $topleft;
  33. border-top-right-radius: $topright;
  34. border-bottom-right-radius: $bottomright;
  35. border-bottom-left-radius: $bottomleft;
  36. border-top-left-radius: $topleft;
  37. -moz-background-clip: padding;
  38. -webkit-background-clip: padding-box;
  39. background-clip: padding-box;
  40. }
  41. @mixin opacity ($opacity: 0.5) {
  42. -webkit-opacity: $opacity;
  43. -moz-opacity: $opacity;
  44. opacity: $opacity;
  45. }
  46. @mixin gradient ($startColor: #eee, $endColor: white) {
  47. background-color: $startColor;
  48. background: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor));
  49. background: -webkit-linear-gradient(top, $startColor, $endColor);
  50. background: -moz-linear-gradient(top, $startColor, $endColor);
  51. background: -ms-linear-gradient(top, $startColor, $endColor);
  52. background: -o-linear-gradient(top, $startColor, $endColor);
  53. }
  54. @mixin horizontal-gradient ($startColor: #eee, $endColor: white) {
  55. background-color: $startColor;
  56. background-image: -webkit-gradient(linear, left top, right top, from($startColor), to($endColor));
  57. background-image: -webkit-linear-gradient(left, $startColor, $endColor);
  58. background-image: -moz-linear-gradient(left, $startColor, $endColor);
  59. background-image: -ms-linear-gradient(left, $startColor, $endColor);
  60. background-image: -o-linear-gradient(left, $startColor, $endColor);
  61. }
  62. @mixin animation ($name, $duration: 300ms, $delay: 0, $ease: ease) {
  63. -webkit-animation: $name $duration $delay $ease;
  64. -moz-animation: $name $duration $delay $ease;
  65. -ms-animation: $name $duration $delay $ease;
  66. }
  67. @mixin transition ($transition) {
  68. -webkit-transition: $transition;
  69. -moz-transition: $transition;
  70. -ms-transition: $transition;
  71. -o-transition: $transition;
  72. }
  73. @mixin transform($string){
  74. -webkit-transform: $string;
  75. -moz-transform: $string;
  76. -ms-transform: $string;
  77. -o-transform: $string;
  78. }
  79. @mixin scale ($factor) {
  80. -webkit-transform: scale($factor);
  81. -moz-transform: scale($factor);
  82. -ms-transform: scale($factor);
  83. -o-transform: scale($factor);
  84. }
  85. @mixin rotate ($deg) {
  86. -webkit-transform: rotate($deg);
  87. -moz-transform: rotate($deg);
  88. -ms-transform: rotate($deg);
  89. -o-transform: rotate($deg);
  90. }
  91. @mixin skew ($deg, $deg2) {
  92. -webkit-transform: skew($deg, $deg2);
  93. -moz-transform: skew($deg, $deg2);
  94. -ms-transform: skew($deg, $deg2);
  95. -o-transform: skew($deg, $deg2);
  96. }
  97. @mixin translate ($x, $y:0) {
  98. -webkit-transform: translate($x, $y);
  99. -moz-transform: translate($x, $y);
  100. -ms-transform: translate($x, $y);
  101. -o-transform: translate($x, $y);
  102. }
  103. @mixin translate3d ($x, $y: 0, $z: 0) {
  104. -webkit-transform: translate3d($x, $y, $z);
  105. -moz-transform: translate3d($x, $y, $z);
  106. -ms-transform: translate3d($x, $y, $z);
  107. -o-transform: translate3d($x, $y, $z);
  108. }
  109. @mixin perspective ($value: 1000) {
  110. -webkit-perspective: $value;
  111. -moz-perspective: $value;
  112. -ms-perspective: $value;
  113. perspective: $value;
  114. }
  115. @mixin transform-origin ($x:center, $y:center) {
  116. -webkit-transform-origin: $x $y;
  117. -moz-transform-origin: $x $y;
  118. -ms-transform-origin: $x $y;
  119. -o-transform-origin: $x $y;
  120. }
  121. @mixin reset-box-sizing ($size:content-box) {
  122. &,
  123. *,
  124. *:before,
  125. *:after {
  126. @include box-sizing($size);
  127. }
  128. }
  129. @mixin truncate ($max-width: 250px) {
  130. max-width: $max-width;
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. }
  135. @mixin background-size ($string: contain) {
  136. -webkit-background-size: $string;
  137. -moz-background-size: $string;
  138. -o-background-size: $string;
  139. background-size: $string;
  140. }
  141. @mixin placeholder ($color: #999) {
  142. &::-webkit-input-placeholder { /* WebKit browsers */
  143. color: $color;
  144. }
  145. &:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
  146. color: $color;
  147. }
  148. &::-moz-placeholder { /* Mozilla Firefox 19+ */
  149. color: $color;
  150. }
  151. &:-ms-input-placeholder { /* Internet Explorer 10+ */
  152. color: $color;
  153. }
  154. }