_vendor-prefixes.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. // Vendor Prefixes
  2. //
  3. // All vendor mixins are deprecated as of v3.2.0 due to the introduction of
  4. // Autoprefixer in our Gruntfile. They will be removed in v4.
  5. // - Animations
  6. // - Backface visibility
  7. // - Box shadow
  8. // - Box sizing
  9. // - Content columns
  10. // - Hyphens
  11. // - Placeholder text
  12. // - Transformations
  13. // - Transitions
  14. // - User Select
  15. // Animations
  16. @mixin animation($animation) {
  17. -webkit-animation: $animation;
  18. -o-animation: $animation;
  19. animation: $animation;
  20. }
  21. @mixin animation-name($name) {
  22. -webkit-animation-name: $name;
  23. animation-name: $name;
  24. }
  25. @mixin animation-duration($duration) {
  26. -webkit-animation-duration: $duration;
  27. animation-duration: $duration;
  28. }
  29. @mixin animation-timing-function($timing-function) {
  30. -webkit-animation-timing-function: $timing-function;
  31. animation-timing-function: $timing-function;
  32. }
  33. @mixin animation-delay($delay) {
  34. -webkit-animation-delay: $delay;
  35. animation-delay: $delay;
  36. }
  37. @mixin animation-iteration-count($iteration-count) {
  38. -webkit-animation-iteration-count: $iteration-count;
  39. animation-iteration-count: $iteration-count;
  40. }
  41. @mixin animation-direction($direction) {
  42. -webkit-animation-direction: $direction;
  43. animation-direction: $direction;
  44. }
  45. @mixin animation-fill-mode($fill-mode) {
  46. -webkit-animation-fill-mode: $fill-mode;
  47. animation-fill-mode: $fill-mode;
  48. }
  49. // Backface visibility
  50. // Prevent browsers from flickering when using CSS 3D transforms.
  51. // Default value is `visible`, but can be changed to `hidden`
  52. @mixin backface-visibility($visibility){
  53. -webkit-backface-visibility: $visibility;
  54. -moz-backface-visibility: $visibility;
  55. backface-visibility: $visibility;
  56. }
  57. // Drop shadows
  58. //
  59. // Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
  60. // supported browsers that have box shadow capabilities now support it.
  61. @mixin box-shadow($shadow...) {
  62. -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
  63. box-shadow: $shadow;
  64. }
  65. // Box sizing
  66. @mixin box-sizing($boxmodel) {
  67. -webkit-box-sizing: $boxmodel;
  68. -moz-box-sizing: $boxmodel;
  69. box-sizing: $boxmodel;
  70. }
  71. // CSS3 Content Columns
  72. @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
  73. -webkit-column-count: $column-count;
  74. -moz-column-count: $column-count;
  75. column-count: $column-count;
  76. -webkit-column-gap: $column-gap;
  77. -moz-column-gap: $column-gap;
  78. column-gap: $column-gap;
  79. }
  80. // Optional hyphenation
  81. @mixin hyphens($mode: auto) {
  82. word-wrap: break-word;
  83. -webkit-hyphens: $mode;
  84. -moz-hyphens: $mode;
  85. -ms-hyphens: $mode; // IE10+
  86. -o-hyphens: $mode;
  87. hyphens: $mode;
  88. }
  89. // Placeholder text
  90. @mixin placeholder($color: $input-color-placeholder) {
  91. // Firefox
  92. &::-moz-placeholder {
  93. color: $color;
  94. opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
  95. }
  96. &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
  97. &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
  98. }
  99. // Transformations
  100. @mixin scale($ratio...) {
  101. -webkit-transform: scale($ratio);
  102. -ms-transform: scale($ratio); // IE9 only
  103. -o-transform: scale($ratio);
  104. transform: scale($ratio);
  105. }
  106. @mixin scaleX($ratio) {
  107. -webkit-transform: scaleX($ratio);
  108. -ms-transform: scaleX($ratio); // IE9 only
  109. -o-transform: scaleX($ratio);
  110. transform: scaleX($ratio);
  111. }
  112. @mixin scaleY($ratio) {
  113. -webkit-transform: scaleY($ratio);
  114. -ms-transform: scaleY($ratio); // IE9 only
  115. -o-transform: scaleY($ratio);
  116. transform: scaleY($ratio);
  117. }
  118. @mixin skew($x, $y) {
  119. -webkit-transform: skewX($x) skewY($y);
  120. -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
  121. -o-transform: skewX($x) skewY($y);
  122. transform: skewX($x) skewY($y);
  123. }
  124. @mixin translate($x, $y) {
  125. -webkit-transform: translate($x, $y);
  126. -ms-transform: translate($x, $y); // IE9 only
  127. -o-transform: translate($x, $y);
  128. transform: translate($x, $y);
  129. }
  130. @mixin translate3d($x, $y, $z) {
  131. -webkit-transform: translate3d($x, $y, $z);
  132. transform: translate3d($x, $y, $z);
  133. }
  134. @mixin rotate($degrees) {
  135. -webkit-transform: rotate($degrees);
  136. -ms-transform: rotate($degrees); // IE9 only
  137. -o-transform: rotate($degrees);
  138. transform: rotate($degrees);
  139. }
  140. @mixin rotateX($degrees) {
  141. -webkit-transform: rotateX($degrees);
  142. -ms-transform: rotateX($degrees); // IE9 only
  143. -o-transform: rotateX($degrees);
  144. transform: rotateX($degrees);
  145. }
  146. @mixin rotateY($degrees) {
  147. -webkit-transform: rotateY($degrees);
  148. -ms-transform: rotateY($degrees); // IE9 only
  149. -o-transform: rotateY($degrees);
  150. transform: rotateY($degrees);
  151. }
  152. @mixin perspective($perspective) {
  153. -webkit-perspective: $perspective;
  154. -moz-perspective: $perspective;
  155. perspective: $perspective;
  156. }
  157. @mixin perspective-origin($perspective) {
  158. -webkit-perspective-origin: $perspective;
  159. -moz-perspective-origin: $perspective;
  160. perspective-origin: $perspective;
  161. }
  162. @mixin transform-origin($origin) {
  163. -webkit-transform-origin: $origin;
  164. -moz-transform-origin: $origin;
  165. -ms-transform-origin: $origin; // IE9 only
  166. transform-origin: $origin;
  167. }
  168. // Transitions
  169. @mixin transition($transition...) {
  170. -webkit-transition: $transition;
  171. -o-transition: $transition;
  172. transition: $transition;
  173. }
  174. @mixin transition-property($transition-property...) {
  175. -webkit-transition-property: $transition-property;
  176. transition-property: $transition-property;
  177. }
  178. @mixin transition-delay($transition-delay) {
  179. -webkit-transition-delay: $transition-delay;
  180. transition-delay: $transition-delay;
  181. }
  182. @mixin transition-duration($transition-duration...) {
  183. -webkit-transition-duration: $transition-duration;
  184. transition-duration: $transition-duration;
  185. }
  186. @mixin transition-timing-function($timing-function) {
  187. -webkit-transition-timing-function: $timing-function;
  188. transition-timing-function: $timing-function;
  189. }
  190. @mixin transition-transform($transition...) {
  191. -webkit-transition: -webkit-transform $transition;
  192. -moz-transition: -moz-transform $transition;
  193. -o-transition: -o-transform $transition;
  194. transition: transform $transition;
  195. }
  196. // User select
  197. // For selecting text on the page
  198. @mixin user-select($select) {
  199. -webkit-user-select: $select;
  200. -moz-user-select: $select;
  201. -ms-user-select: $select; // IE10+
  202. user-select: $select;
  203. }