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.

227 lines
6.5 KiB

10 years ago
  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. .animation(@animation) {
  17. -webkit-animation: @animation;
  18. -o-animation: @animation;
  19. animation: @animation;
  20. }
  21. .animation-name(@name) {
  22. -webkit-animation-name: @name;
  23. animation-name: @name;
  24. }
  25. .animation-duration(@duration) {
  26. -webkit-animation-duration: @duration;
  27. animation-duration: @duration;
  28. }
  29. .animation-timing-function(@timing-function) {
  30. -webkit-animation-timing-function: @timing-function;
  31. animation-timing-function: @timing-function;
  32. }
  33. .animation-delay(@delay) {
  34. -webkit-animation-delay: @delay;
  35. animation-delay: @delay;
  36. }
  37. .animation-iteration-count(@iteration-count) {
  38. -webkit-animation-iteration-count: @iteration-count;
  39. animation-iteration-count: @iteration-count;
  40. }
  41. .animation-direction(@direction) {
  42. -webkit-animation-direction: @direction;
  43. animation-direction: @direction;
  44. }
  45. .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. .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. .box-shadow(@shadow) {
  62. -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
  63. box-shadow: @shadow;
  64. }
  65. // Box sizing
  66. .box-sizing(@boxmodel) {
  67. -webkit-box-sizing: @boxmodel;
  68. -moz-box-sizing: @boxmodel;
  69. box-sizing: @boxmodel;
  70. }
  71. // CSS3 Content Columns
  72. .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. .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. .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. .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. .scale(@ratioX; @ratioY) {
  107. -webkit-transform: scale(@ratioX, @ratioY);
  108. -ms-transform: scale(@ratioX, @ratioY); // IE9 only
  109. -o-transform: scale(@ratioX, @ratioY);
  110. transform: scale(@ratioX, @ratioY);
  111. }
  112. .scaleX(@ratio) {
  113. -webkit-transform: scaleX(@ratio);
  114. -ms-transform: scaleX(@ratio); // IE9 only
  115. -o-transform: scaleX(@ratio);
  116. transform: scaleX(@ratio);
  117. }
  118. .scaleY(@ratio) {
  119. -webkit-transform: scaleY(@ratio);
  120. -ms-transform: scaleY(@ratio); // IE9 only
  121. -o-transform: scaleY(@ratio);
  122. transform: scaleY(@ratio);
  123. }
  124. .skew(@x; @y) {
  125. -webkit-transform: skewX(@x) skewY(@y);
  126. -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
  127. -o-transform: skewX(@x) skewY(@y);
  128. transform: skewX(@x) skewY(@y);
  129. }
  130. .translate(@x; @y) {
  131. -webkit-transform: translate(@x, @y);
  132. -ms-transform: translate(@x, @y); // IE9 only
  133. -o-transform: translate(@x, @y);
  134. transform: translate(@x, @y);
  135. }
  136. .translate3d(@x; @y; @z) {
  137. -webkit-transform: translate3d(@x, @y, @z);
  138. transform: translate3d(@x, @y, @z);
  139. }
  140. .rotate(@degrees) {
  141. -webkit-transform: rotate(@degrees);
  142. -ms-transform: rotate(@degrees); // IE9 only
  143. -o-transform: rotate(@degrees);
  144. transform: rotate(@degrees);
  145. }
  146. .rotateX(@degrees) {
  147. -webkit-transform: rotateX(@degrees);
  148. -ms-transform: rotateX(@degrees); // IE9 only
  149. -o-transform: rotateX(@degrees);
  150. transform: rotateX(@degrees);
  151. }
  152. .rotateY(@degrees) {
  153. -webkit-transform: rotateY(@degrees);
  154. -ms-transform: rotateY(@degrees); // IE9 only
  155. -o-transform: rotateY(@degrees);
  156. transform: rotateY(@degrees);
  157. }
  158. .perspective(@perspective) {
  159. -webkit-perspective: @perspective;
  160. -moz-perspective: @perspective;
  161. perspective: @perspective;
  162. }
  163. .perspective-origin(@perspective) {
  164. -webkit-perspective-origin: @perspective;
  165. -moz-perspective-origin: @perspective;
  166. perspective-origin: @perspective;
  167. }
  168. .transform-origin(@origin) {
  169. -webkit-transform-origin: @origin;
  170. -moz-transform-origin: @origin;
  171. -ms-transform-origin: @origin; // IE9 only
  172. transform-origin: @origin;
  173. }
  174. // Transitions
  175. .transition(@transition) {
  176. -webkit-transition: @transition;
  177. -o-transition: @transition;
  178. transition: @transition;
  179. }
  180. .transition-property(@transition-property) {
  181. -webkit-transition-property: @transition-property;
  182. transition-property: @transition-property;
  183. }
  184. .transition-delay(@transition-delay) {
  185. -webkit-transition-delay: @transition-delay;
  186. transition-delay: @transition-delay;
  187. }
  188. .transition-duration(@transition-duration) {
  189. -webkit-transition-duration: @transition-duration;
  190. transition-duration: @transition-duration;
  191. }
  192. .transition-timing-function(@timing-function) {
  193. -webkit-transition-timing-function: @timing-function;
  194. transition-timing-function: @timing-function;
  195. }
  196. .transition-transform(@transition) {
  197. -webkit-transition: -webkit-transform @transition;
  198. -moz-transition: -moz-transform @transition;
  199. -o-transition: -o-transform @transition;
  200. transition: transform @transition;
  201. }
  202. // User select
  203. // For selecting text on the page
  204. .user-select(@select) {
  205. -webkit-user-select: @select;
  206. -moz-user-select: @select;
  207. -ms-user-select: @select; // IE10+
  208. user-select: @select;
  209. }