説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

mixins.scss 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. @function tint( $color, $percent ) {
  2. @return mix(white, $color, $percent);
  3. }
  4. @function shade( $color, $percent ) {
  5. @return mix(black, $color, $percent);
  6. }
  7. @mixin border-radius ( $radius ) {
  8. -webkit-border-radius: $radius;
  9. -moz-border-radius: $radius;
  10. -ms-border-radius: $radius;
  11. -o-border-radius: $radius;
  12. border-radius: $radius;
  13. }
  14. @mixin box-sizing($box-model) {
  15. -webkit-box-sizing: $box-model; // Safari <= 5
  16. -moz-box-sizing: $box-model; // Firefox <= 19
  17. box-sizing: $box-model;
  18. }
  19. @mixin box-shadow($top, $left, $blur, $color, $inset: false) {
  20. @if $inset {
  21. -webkit-box-shadow:inset $top $left $blur $color;
  22. -moz-box-shadow:inset $top $left $blur $color;
  23. box-shadow:inset $top $left $blur $color;
  24. } @else {
  25. -webkit-box-shadow: $top $left $blur $color;
  26. -moz-box-shadow: $top $left $blur $color;
  27. box-shadow: $top $left $blur $color;
  28. }
  29. }
  30. @mixin two-stop-gradient($fromColor, $toColor) {
  31. background-color: $toColor; /* Fallback */
  32. background-image: -webkit-linear-gradient(top, $fromColor 0%, $toColor 100%); /* Chrome 10+, Saf5.1+, iOS 5+ */
  33. background-image: -moz-linear-gradient(top, $fromColor 0%, $toColor 100%); /* FF3.6 */
  34. background-image: -ms-linear-gradient(top, $fromColor 0%, $toColor 100%); /* IE10 */
  35. background-image: -o-linear-gradient(top, $fromColor 0%, $toColor 100%); /* Opera 11.10+ */
  36. background-image: linear-gradient(to bottom, $fromColor 0%, $toColor 100%);
  37. filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#{nth( $fromColor, 1 )}', EndColorStr='#{nth( $toColor, 1 )}');
  38. }
  39. @mixin three-stop-gradient($fromColor, $middleColor, $toColor) {
  40. background-color: $toColor; /* Fallback */
  41. background-image: -webkit-linear-gradient(top, $fromColor, $middleColor, $toColor); /* Chrome 10+, Saf5.1+, iOS 5+ */
  42. background-image: -moz-linear-gradient(top, $fromColor, $middleColor, $toColor); /* FF3.6 */
  43. background-image: -ms-linear-gradient(top, $fromColor, $middleColor, $toColor); /* IE10 */
  44. background-image: -o-linear-gradient(top, $fromColor, $middleColor, $toColor); /* Opera 11.10+ */
  45. background-image: linear-gradient(to bottom, $fromColor, $middleColor, $toColor);
  46. filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#{nth( $fromColor, 1 )}', EndColorStr='#{nth( $toColor, 1 )}');
  47. }
  48. @mixin radial-gradient ($fromColor, $toColor ) {
  49. background: $toColor; /* Fallback */
  50. background: -ms-radial-gradient(center, ellipse farthest-corner, $fromColor 0%, $toColor 100%); /* IE10 Consumer Preview */
  51. background: -moz-radial-gradient(center, ellipse farthest-corner, $fromColor 0%, $toColor 100%); /* Firefox */
  52. background: -o-radial-gradient(center, ellipse farthest-corner, $fromColor 0%, $toColor 100%); /* Opera */
  53. background: -webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, $fromColor), color-stop(1, $toColor)); /* Webkit (Safari/Chrome 10) */
  54. background: -webkit-radial-gradient(center, ellipse farthest-corner, $fromColor 0%, $toColor 100%); /* Webkit (Chrome 11+) */
  55. background: radial-gradient(ellipse farthest-corner at center, $fromColor 0%, $toColor 100%); /* W3C Markup, IE10 Release Preview */
  56. }
  57. @mixin keyframe ($animation_name) {
  58. @-webkit-keyframes #{$animation_name} {
  59. @content;
  60. }
  61. @-moz-keyframes #{$animation_name} {
  62. @content;
  63. }
  64. @-o-keyframes #{$animation_name} {
  65. @content;
  66. }
  67. @keyframes #{$animation_name} {
  68. @content;
  69. }
  70. }
  71. @mixin animation ($duration, $animation) {
  72. -webkit-animation-duration: $duration;
  73. -webkit-animation-name: $animation;
  74. -webkit-animation-fill-mode: forwards;
  75. -webkit-animation-iteration-count: infinite;
  76. -webkit-animation-timing-function: linear;
  77. -webkit-animation-direction: alternate;
  78. -moz-animation-duration: $duration;
  79. -moz-animation-name: $animation;
  80. -moz-animation-fill-mode: forwards;
  81. -moz-animation-iteration-count: infinite;
  82. -moz-animation-timing-function: linear;
  83. -moz-animation-direction: alternate;
  84. -o-animation-duration: $duration;
  85. -o-animation-name: $animation;
  86. -o-animation-fill-mode: forwards;
  87. -o-animation-iteration-count: infinite;
  88. -o-animation-timing-function: linear;
  89. -o-animation-direction: alternate;
  90. animation-duration: $duration;
  91. animation-name: $animation;
  92. animation-fill-mode: forwards;
  93. animation-iteration-count: infinite;
  94. animation-timing-function: linear;
  95. animation-direction: alternate;
  96. }
  97. @mixin close-icon () {
  98. position: absolute;
  99. top: -11px;
  100. right: -11px;
  101. width: 22px;
  102. height: 22px;
  103. border: 2px solid white;
  104. background-color: black;
  105. text-align: center;
  106. border-radius: 15px;
  107. cursor: pointer;
  108. z-index: 12;
  109. box-shadow: 2px 2px 6px #111;
  110. &:after {
  111. content: '\00d7';
  112. color: white;
  113. font-weight: bold;
  114. font-size: 18px;
  115. line-height: 22px;
  116. font-family: 'Courier New', Courier, monospace;
  117. padding-left: 1px;
  118. }
  119. &:hover {
  120. background-color: #092079;
  121. box-shadow: 2px 2px 9px #111;
  122. }
  123. }
  124. @mixin overlay-background () {
  125. position: fixed;
  126. top: 0;
  127. left: 0;
  128. width: 100%;
  129. height: 100%;
  130. @include radial-gradient( rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7) );
  131. z-index: 10;
  132. // IE8- doesn't support RGBA and jQuery uses `filter:` for the fade-in
  133. // animation, so we need a child element that is used just for the display
  134. >div {
  135. position: absolute;
  136. top: 0;
  137. right: 0;
  138. left: 0;
  139. bottom: 0;
  140. // IE7-
  141. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
  142. // IE8
  143. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
  144. }
  145. // IE9 has both filter and rgba support, so we need a hack to disable the filter
  146. >div:not([dummy]) {
  147. filter: progid:DXImageTransform.Microsoft.gradient(enabled='false');
  148. }
  149. }
  150. @mixin background-transision () {
  151. -webkit-transition: background-color 500ms linear;
  152. -moz-transition: background-color 500ms linear;
  153. -ms-transition: background-color 500ms linear;
  154. -o-transition: background-color 500ms linear;
  155. transition: background-color 500ms linear;
  156. }