mixins.sass 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. @import "initial-variables"
  2. =arrow($color)
  3. border: 1px solid $color
  4. border-right: 0
  5. border-top: 0
  6. content: " "
  7. display: block
  8. height: 0.5em
  9. pointer-events: none
  10. position: absolute
  11. transform: rotate(-45deg)
  12. width: 0.5em
  13. =block
  14. &:not(:last-child)
  15. margin-bottom: 1.5rem
  16. =clearfix
  17. &:after
  18. clear: both
  19. content: " "
  20. display: table
  21. =center($width, $height: 0)
  22. position: absolute
  23. @if $height != 0
  24. left: calc(50% - (#{$width} / 2))
  25. top: calc(50% - (#{$height} / 2))
  26. @else
  27. left: calc(50% - (#{$width} / 2))
  28. top: calc(50% - (#{$width} / 2))
  29. =delete
  30. +unselectable
  31. -moz-appearance: none
  32. -webkit-appearance: none
  33. background-color: rgba($black, 0.2)
  34. border: none
  35. border-radius: 290486px
  36. cursor: pointer
  37. display: inline-block
  38. flex-grow: 0
  39. flex-shrink: 0
  40. font-size: 0
  41. height: 20px
  42. max-height: 20px
  43. max-width: 20px
  44. min-height: 20px
  45. min-width: 20px
  46. outline: none
  47. position: relative
  48. vertical-align: top
  49. width: 20px
  50. &:before,
  51. &:after
  52. background-color: $white
  53. content: ""
  54. display: block
  55. left: 50%
  56. position: absolute
  57. top: 50%
  58. transform: translateX(-50%) translateY(-50%) rotate(45deg)
  59. transform-origin: center center
  60. &:before
  61. height: 2px
  62. width: 50%
  63. &:after
  64. height: 50%
  65. width: 2px
  66. &:hover,
  67. &:focus
  68. background-color: rgba($black, 0.3)
  69. &:active
  70. background-color: rgba($black, 0.4)
  71. // Sizes
  72. &.is-small
  73. height: 16px
  74. max-height: 16px
  75. max-width: 16px
  76. min-height: 16px
  77. min-width: 16px
  78. width: 16px
  79. &.is-medium
  80. height: 24px
  81. max-height: 24px
  82. max-width: 24px
  83. min-height: 24px
  84. min-width: 24px
  85. width: 24px
  86. &.is-large
  87. height: 32px
  88. max-height: 32px
  89. max-width: 32px
  90. min-height: 32px
  91. min-width: 32px
  92. width: 32px
  93. =fa($size, $dimensions)
  94. display: inline-block
  95. font-size: $size
  96. height: $dimensions
  97. line-height: $dimensions
  98. text-align: center
  99. vertical-align: top
  100. width: $dimensions
  101. =hamburger($dimensions)
  102. cursor: pointer
  103. display: block
  104. height: $dimensions
  105. position: relative
  106. width: $dimensions
  107. span
  108. background-color: currentColor
  109. display: block
  110. height: 1px
  111. left: calc(50% - 8px)
  112. position: absolute
  113. transform-origin: center
  114. transition-duration: $speed
  115. transition-property: background-color, opacity, transform
  116. transition-timing-function: $easing
  117. width: 16px
  118. &:nth-child(1)
  119. top: calc(50% - 6px)
  120. &:nth-child(2)
  121. top: calc(50% - 1px)
  122. &:nth-child(3)
  123. top: calc(50% + 4px)
  124. &:hover
  125. background-color: rgba(black, 0.05)
  126. // Modifers
  127. &.is-active
  128. span
  129. &:nth-child(1)
  130. transform: translateY(5px) rotate(45deg)
  131. &:nth-child(2)
  132. opacity: 0
  133. &:nth-child(3)
  134. transform: translateY(-5px) rotate(-45deg)
  135. =loader
  136. animation: spinAround 500ms infinite linear
  137. border: 2px solid $border
  138. border-radius: 290486px
  139. border-right-color: transparent
  140. border-top-color: transparent
  141. content: ""
  142. display: block
  143. height: 1em
  144. position: relative
  145. width: 1em
  146. =overflow-touch
  147. -webkit-overflow-scrolling: touch
  148. =overlay($offset: 0)
  149. bottom: $offset
  150. left: $offset
  151. position: absolute
  152. right: $offset
  153. top: $offset
  154. =placeholder
  155. $placeholders: ':-moz' ':-webkit-input' '-moz' '-ms-input'
  156. @each $placeholder in $placeholders
  157. &:#{$placeholder}-placeholder
  158. @content
  159. =unselectable
  160. -webkit-touch-callout: none
  161. -webkit-user-select: none
  162. -moz-user-select: none
  163. -ms-user-select: none
  164. user-select: none
  165. // Responsiveness
  166. =from($device)
  167. @media screen and (min-width: $device)
  168. @content
  169. =until($device)
  170. @media screen and (max-width: $device - 1px)
  171. @content
  172. =mobile
  173. @media screen and (max-width: $tablet - 1px)
  174. @content
  175. =tablet
  176. @media screen and (min-width: $tablet), print
  177. @content
  178. =tablet-only
  179. @media screen and (min-width: $tablet) and (max-width: $desktop - 1px)
  180. @content
  181. =touch
  182. @media screen and (max-width: $desktop - 1px)
  183. @content
  184. =desktop
  185. @media screen and (min-width: $desktop)
  186. @content
  187. =desktop-only
  188. @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
  189. @content
  190. =widescreen
  191. @media screen and (min-width: $widescreen)
  192. @content
  193. =widescreen-only
  194. @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
  195. @content
  196. =fullhd
  197. @media screen and (min-width: $fullhd)
  198. @content