mixins.sass 5.4 KB

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