_mixins.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /**
  2. * Deprecated
  3. * Fallback for bourbon equivalent
  4. */
  5. @mixin clearfix() {
  6. *zoom: 1;
  7. &::before,
  8. &::after {
  9. content: ' ';
  10. display: table;
  11. }
  12. &::after {
  13. clear: both;
  14. }
  15. }
  16. /**
  17. * Deprecated
  18. * Vendor prefix no longer required.
  19. */
  20. @mixin border_radius($radius: 4px) {
  21. border-radius: $radius;
  22. }
  23. /**
  24. * Deprecated
  25. * Vendor prefix no longer required.
  26. */
  27. @mixin border_radius_right($radius: 4px) {
  28. border-top-right-radius: $radius;
  29. border-bottom-right-radius: $radius;
  30. }
  31. /**
  32. * Deprecated
  33. * Vendor prefix no longer required.
  34. */
  35. @mixin border_radius_left($radius: 4px) {
  36. border-top-left-radius: $radius;
  37. border-bottom-left-radius: $radius;
  38. }
  39. /**
  40. * Deprecated
  41. * Vendor prefix no longer required.
  42. */
  43. @mixin border_radius_bottom($radius: 4px) {
  44. border-bottom-left-radius: $radius;
  45. border-bottom-right-radius: $radius;
  46. }
  47. /**
  48. * Deprecated
  49. * Vendor prefix no longer required.
  50. */
  51. @mixin border_radius_top($radius: 4px) {
  52. border-top-left-radius: $radius;
  53. border-top-right-radius: $radius;
  54. }
  55. /**
  56. * Deprecated
  57. * Vendor prefix no longer required.
  58. */
  59. @mixin opacity( $opacity: 0.75 ) {
  60. opacity: $opacity;
  61. }
  62. /**
  63. * Deprecated
  64. * Vendor prefix no longer required.
  65. */
  66. @mixin box_shadow($shadow_x: 3px, $shadow_y: 3px, $shadow_rad: 3px, $shadow_in: 3px, $shadow_color: #888) {
  67. box-shadow: $shadow_x $shadow_y $shadow_rad $shadow_in $shadow_color;
  68. }
  69. /**
  70. * Deprecated
  71. * Vendor prefix no longer required.
  72. */
  73. @mixin inset_box_shadow($shadow_x: 3px, $shadow_y: 3px, $shadow_rad: 3px, $shadow_in: 3px, $shadow_color: #888) {
  74. box-shadow: inset $shadow_x $shadow_y $shadow_rad $shadow_in $shadow_color;
  75. }
  76. /**
  77. * Deprecated
  78. * Vendor prefix no longer required.
  79. */
  80. @mixin text_shadow($shadow_x: 3px, $shadow_y: 3px, $shadow_rad: 3px, $shadow_color: #fff) {
  81. text-shadow: $shadow_x $shadow_y $shadow_rad $shadow_color;
  82. }
  83. /**
  84. * Deprecated
  85. * Vendor prefix no longer required.
  86. */
  87. @mixin vertical_gradient($from: #000, $to: #fff) {
  88. background-color: $from;
  89. background: -webkit-linear-gradient($from, $to);
  90. }
  91. /**
  92. * Deprecated
  93. * Vendor prefix no longer required.
  94. */
  95. @mixin transition($selector: all, $animation: ease-in-out, $duration: 0.2s) {
  96. transition: $selector $animation $duration;
  97. }
  98. /**
  99. * Deprecated
  100. * Use bourbon mixin instead `@include transform(scale(1.5));`
  101. */
  102. @mixin scale($ratio: 1.5) {
  103. -webkit-transform: scale($ratio);
  104. transform: scale($ratio);
  105. }
  106. /**
  107. * Deprecated
  108. * Use bourbon mixin instead `@include box-sizing(border-box);`
  109. */
  110. @mixin borderbox() {
  111. box-sizing: border-box;
  112. }
  113. @mixin darkorlighttextshadow($a, $opacity: 0.8) {
  114. @if lightness($a) >= 65% {
  115. @include text_shadow(0, -1px, 0, rgba(0, 0, 0, $opacity));
  116. }
  117. @else {
  118. @include text_shadow(0, 1px, 0, rgba(255, 255, 255, $opacity));
  119. }
  120. }
  121. /**
  122. * Objects
  123. */
  124. @mixin menu() {
  125. @include clearfix();
  126. li {
  127. display: inline-block;
  128. }
  129. }
  130. @mixin mediaright() {
  131. @include clearfix();
  132. img {
  133. float: right;
  134. height: auto;
  135. }
  136. }
  137. @mixin medialeft() {
  138. @include clearfix();
  139. img {
  140. float: right;
  141. height: auto;
  142. }
  143. }
  144. @mixin ir() {
  145. display: block;
  146. text-indent: -9999px;
  147. position: relative;
  148. height: 1em;
  149. width: 1em;
  150. }
  151. @mixin icon( $glyph: '\e001' ) {
  152. font-family: 'WooCommerce';
  153. speak: none;
  154. font-weight: normal;
  155. font-variant: normal;
  156. text-transform: none;
  157. line-height: 1;
  158. -webkit-font-smoothing: antialiased;
  159. margin: 0;
  160. text-indent: 0;
  161. position: absolute;
  162. top: 0;
  163. left: 0;
  164. width: 100%;
  165. height: 100%;
  166. text-align: center;
  167. content: $glyph;
  168. }
  169. @mixin icon_dashicons( $glyph: '\f333' ) {
  170. font-family: 'Dashicons';
  171. speak: none;
  172. font-weight: normal;
  173. font-variant: normal;
  174. text-transform: none;
  175. line-height: 1;
  176. -webkit-font-smoothing: antialiased;
  177. margin: 0;
  178. text-indent: 0;
  179. position: absolute;
  180. top: 0;
  181. left: 0;
  182. width: 100%;
  183. height: 100%;
  184. text-align: center;
  185. content: $glyph;
  186. }
  187. @mixin iconbefore( $glyph: '\e001' ) {
  188. font-family: 'WooCommerce';
  189. speak: none;
  190. font-weight: normal;
  191. font-variant: normal;
  192. text-transform: none;
  193. line-height: 1;
  194. -webkit-font-smoothing: antialiased;
  195. margin-right: 0.618em;
  196. content: $glyph;
  197. text-decoration: none;
  198. }
  199. @mixin iconbeforedashicons( $glyph: '\f333' ) {
  200. font-family: 'Dashicons';
  201. speak: none;
  202. font-weight: normal;
  203. font-variant: normal;
  204. text-transform: none;
  205. line-height: 1;
  206. -webkit-font-smoothing: antialiased;
  207. content: $glyph;
  208. text-decoration: none;
  209. }
  210. @mixin iconafter( $glyph: '\e001' ) {
  211. font-family: 'WooCommerce';
  212. speak: none;
  213. font-weight: normal;
  214. font-variant: normal;
  215. text-transform: none;
  216. line-height: 1;
  217. -webkit-font-smoothing: antialiased;
  218. margin-left: 0.618em;
  219. content: $glyph;
  220. text-decoration: none;
  221. }
  222. @mixin loader() {
  223. &::before {
  224. height: 1em;
  225. width: 1em;
  226. display: block;
  227. position: absolute;
  228. top: 50%;
  229. left: 50%;
  230. margin-left: -0.5em;
  231. margin-top: -0.5em;
  232. content: '';
  233. animation: spin 1s ease-in-out infinite;
  234. background: url('../images/icons/loader.svg') center center;
  235. background-size: cover;
  236. line-height: 1;
  237. text-align: center;
  238. font-size: 2em;
  239. color: rgba(#000, 0.75);
  240. }
  241. }