Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. // @import "variables";
  2.  
  3. @mixin transition-default($duration: .1s, $property: all, $delay: .0s) {
  4. transition: $property $duration $transitionDefaultTimingFunction $delay;
  5. }
  6.  
  7. @mixin transition-series($params...) {
  8. transition: $params;
  9. }
  10.  
  11. @mixin transition-only-for($duration: .5s, $properties: (all), $delay: 0s, $transitionTimingFunction: $transitionDefaultTimingFunction) {
  12. $scaffold: ();
  13. @each $property in $properties {
  14. $scaffold: append($scaffold, #{$property} #{$duration} #{$transitionTimingFunction} #{$delay}, comma);
  15. }
  16. transition: $scaffold;
  17. }
  18.  
  19. /**
  20. * Extended mixin taken from angular-material (@see )
  21. * @param {string} $color - color for input placeholder
  22. * @param {:hover|:active|:focus|null} $target-pseudo - parent pseudo-class
  23. * E.g.: @include input-placeholder-color(#faf);
  24. * E.g.: @include input-placeholder-color(#faf, (hover: #ff0));
  25. * E.g.: @include input-placeholder-color(#faf, (hover: #ff0, active: #0ff), false) {
  26. * transition: all .2s ease;
  27. * }
  28. */
  29. @mixin input-placeholder-color($color, $target-pseudo-colors: (), $contentInBase: true) {
  30. $pseudos: '::-webkit-input-placeholder', ':-moz-placeholder', '::-moz-placeholder',
  31. ':-ms-input-placeholder', '::-webkit-input-placeholder';
  32.  
  33. @each $pseudo in $pseudos {
  34. &#{$pseudo} {
  35. color: $color;
  36. @if ($contentInBase) {
  37. @content;
  38. }
  39. }
  40. @each $target-pseudo, $target-pseudo-color in $target-pseudo-colors {
  41. &:#{$target-pseudo}#{$pseudo} {
  42. color: $target-pseudo-color;
  43. @if (not $contentInBase) {
  44. @content;
  45. }
  46. }
  47. }
  48. }
  49. }
  50.  
  51. // xs, sm, md, lg, xl
  52. @mixin media-query($media, $orientation: null) {
  53. @if $media == xs or $media == lr-xs {
  54. @if ($orientation) {
  55. @media screen and (max-width: $layout-breakpoint-xs - 1) and (orientation: $orientation) { @content; }
  56. }
  57. @else {
  58. @media screen and (max-width: $layout-breakpoint-xs - 1) { @content; }
  59. }
  60. }
  61. @else if $media == gt-xs {
  62. @if ($orientation) {
  63. @media screen and (min-width: $layout-breakpoint-xs) and (orientation: $orientation) { @content; }
  64. }
  65. @else {
  66. @media screen and (min-width: $layout-breakpoint-xs) { @content; }
  67. }
  68. }
  69. @else if $media == sm {
  70. @if ($orientation) {
  71. @media screen and (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) and (orientation: $orientation) { @content; }
  72. }
  73. @else {
  74. @media screen and (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) { @content; }
  75. }
  76. }
  77. @else if $media == lr-sm {
  78. @if ($orientation) {
  79. @media screen and (max-width: $layout-breakpoint-sm - 1) and (orientation: $orientation) { @content; }
  80. }
  81. @else {
  82. @media screen and (max-width: $layout-breakpoint-sm - 1) { @content; }
  83. }
  84. }
  85. @else if $media == gt-sm {
  86. @if ($orientation) {
  87. @media screen and (min-width: $layout-breakpoint-sm) and (orientation: $orientation) { @content; }
  88. }
  89. @else {
  90. @media screen and (min-width: $layout-breakpoint-sm) { @content; }
  91. }
  92. }
  93. @else if $media == md {
  94. @if ($orientation) {
  95. @media screen and (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) and (orientation: $orientation) { @content; }
  96. }
  97. @else {
  98. @media screen and (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) { @content; }
  99. }
  100. }
  101. @else if $media == lr-md {
  102. @if ($orientation) {
  103. @media screen and (max-width: $layout-breakpoint-md - 1) and (orientation: $orientation) { @content; }
  104. }
  105. @else {
  106. @media screen and (max-width: $layout-breakpoint-md - 1) { @content; }
  107. }
  108. }
  109. @else if $media == gt-md {
  110. @if ($orientation) {
  111. @media screen and (min-width: $layout-breakpoint-md) and (orientation: $orientation) { @content; }
  112. }
  113. @else {
  114. @media screen and (min-width: $layout-breakpoint-md) { @content; }
  115. }
  116. }
  117. @else if $media == lg {
  118. @if ($orientation) {
  119. @media screen and (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) and (orientation: $orientation) { @content; }
  120. }
  121. @else {
  122. @media screen and (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) { @content; }
  123. }
  124. }
  125. @else if $media == lr-lg or $media == lr-xl {
  126. @if ($orientation) {
  127. @media screen and (max-width: $layout-breakpoint-lg - 1) and (orientation: $orientation) { @content; }
  128. }
  129. @else {
  130. @media screen and (max-width: $layout-breakpoint-lg - 1) { @content; }
  131. }
  132. }
  133. @else if $media == gt-lg {
  134. @if ($orientation) {
  135. @media screen and (min-width: $layout-breakpoint-lg) and (orientation: $orientation) { @content; }
  136. }
  137. @else {
  138. @media screen and (min-width: $layout-breakpoint-lg) { @content; }
  139. }
  140. }
  141. @else if $media == xl or $media == gt-xl {
  142. @if ($orientation) {
  143. @media screen and (min-width: $layout-breakpoint-lg) and (orientation: $orientation) { @content; }
  144. }
  145. @else {
  146. @media screen and (min-width: $layout-breakpoint-lg) { @content; }
  147. }
  148. }
  149. @else {
  150. @if ($orientation) {
  151. @media screen and (orientation: $orientation) { @content; }
  152. }
  153. @else {
  154. @media screen { @content; }
  155. }
  156. }
  157. }
  158.  
  159. @mixin media-query-toolbar($property) {
  160. #{$property}: $toolbar-height;
  161. @include media-query(lr-sm, landscape) {
  162. #{$property}: $toolbar-height-mobile-landscape;
  163. }
  164. @include media-query(lr-sm, portrait) {
  165. #{$property}: $toolbar-height-mobile-portrait;
  166. }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement