mixins.sass 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. //
  2. // Site Name:
  3. // Author:
  4. //
  5. // Stylesheet: Mixins & Constants Stylesheet
  6. //
  7. // This is where you can take advantage of LESS' great features:
  8. // Mixins & Constants. I won't go in-depth on how they work exactly,
  9. // there are a few articles below that will help do that. What I will
  10. // tell you is that this will help speed up simple changes like
  11. // changing a color or adding CSS3 techniques like box shadow and
  12. // border-radius.
  13. //
  14. // A WORD OF WARNING: It's very easy to overdo it here. Be careful and
  15. // remember less is more.
  16. //
  17. //
  18. //
  19. // CLEARFIXIN'
  20. //
  21. // Contain floats: nicolasgallagher.com/micro-clearfix-hack/
  22. .clearfix
  23. &:before,
  24. &:after
  25. content: ""
  26. display: table
  27. &:after
  28. clear: both
  29. zoom: 1
  30. //
  31. // TOOLS
  32. //
  33. // http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/
  34. .image-replacement
  35. text-indent: 100%
  36. white-space: nowrap
  37. overflow: hidden
  38. //
  39. // COLORS
  40. // Need help w/ choosing your colors? Try this site out:
  41. // http://0to255.com/
  42. //
  43. $yellow: #ebe16f
  44. $red: #fbe3e4
  45. $green: #e6efc2
  46. $blue: #d5edf8
  47. $black: #000
  48. $grayDark: lighten($black, 25%)
  49. $gray: lighten($black, 50%)
  50. $grayLight: lighten($black, 75%)
  51. $grayLighter: lighten($black, 90%)
  52. $white: #fff
  53. // this is pulled from Bootstrap
  54. $baseColor: $black // Set a base color
  55. $complement: spin($baseColor, 180) // Determine a complementary color
  56. $split1: spin($baseColor, 158) // Split complements
  57. $split2: spin($baseColor, -158)
  58. $triad1: spin($baseColor, 135) // Triads colors
  59. $triad2: spin($baseColor, -135)
  60. $tetra1: spin($baseColor, 90) // Tetra colors
  61. $tetra2: spin($baseColor, -90)
  62. $analog1: spin($baseColor, 22) // Analogs colors
  63. $analog2: spin($baseColor, -22)
  64. //
  65. // TYPOGRAPHY
  66. //
  67. $sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif
  68. $serif: "Georgia", Cambria, Times New Roman, Times, serif
  69. // To embed your own fonts, use this syntax
  70. // and place your fonts inside the
  71. // library/fonts folder. For more information
  72. // on embedding fonts, go to:
  73. // http://www.fontsquirrel.com/
  74. // Be sure to remove the comment brackets.
  75. //
  76. // @font-face
  77. // font-family: 'Font Name'
  78. // src: url('../fonts/font-name.eot')
  79. // src: url('../fonts/font-name.eot?#iefix') format('embedded-opentype'),
  80. // url('../fonts/font-name.woff') format('woff'),
  81. // url('../fonts/font-name.ttf') format('truetype'),
  82. // url('../fonts/font-name.svg#font-name') format('svg')
  83. // font-weight: normal
  84. // font-style: normal
  85. //
  86. //
  87. //
  88. // use the best ampersand
  89. // http://simplebits.com/notebook/2008/08/14/ampersands-2/
  90. span.amp
  91. font-family: Baskerville,'Goudy Old Style',Palatino,'Book Antiqua',serif
  92. font-style: italic
  93. // text alignment
  94. .text-left
  95. text-align: left
  96. .text-center
  97. text-align: center
  98. .text-right
  99. text-align: right
  100. // alerts & notices
  101. .help, .info, .error, .success
  102. margin: 10px
  103. padding: 5px 18px
  104. border: 1px solid
  105. .help
  106. border-color: darken($yellow, 5%)
  107. background: $yellow
  108. .info
  109. border-color: darken($blue, 5%)
  110. background: $blue
  111. .error
  112. border-color: darken($red, 5%)
  113. background: $red
  114. .success
  115. border-color: darken($green, 5%)
  116. background: $green
  117. //
  118. // BORDER RADIUS
  119. //
  120. // @include borderRadius(4px);
  121. @mixin borderRadius($radius: 4px)
  122. -webkit-border-radius: $radius
  123. -moz-border-radius: $radius
  124. -ms-border-radius: $radius
  125. -o-border-radius: $radius
  126. border-radius: $radius
  127. // @include borderTopRadius(4px);
  128. @mixin borderTopRadius($radius: 4px)
  129. -webkit-border-top-right-radius: $radius
  130. -webkit-border-top-left-radius: $radius
  131. -moz-border-radius-topright: $radius
  132. -moz-border-radius-topleft: $radius
  133. border-top-right-radius: $radius
  134. border-top-left-radius: $radius
  135. // @include borderRightRadius(4px);
  136. @mixin borderRightRadius($radius: 4px)
  137. -webkit-border-top-right-radius: $radius
  138. -webkit-border-bottom-right-radius: $radius
  139. -moz-border-radius-topright: $radius
  140. -moz-border-radius-bottomright: $radius
  141. border-top-right-radius: $radius
  142. border-bottom-right-radius: $radius
  143. // @include borderBottomRadius(4px);
  144. @mixin borderBottomRadius($radius: 4px)
  145. -webkit-border-bottom-right-radius: $radius
  146. -webkit-border-bottom-left-radius: $radius
  147. -moz-border-radius-bottomright: $radius
  148. -moz-border-radius-bottomleft: $radius
  149. border-bottom-right-radius: $radius
  150. border-bottom-left-radius: $radius
  151. // @include borderLeftRadius(4px);
  152. @mixin borderLeftRadius($radius: 4px)
  153. -webkit-border-top-left-radius: $radius
  154. -webkit-border-bottom-left-radius: $radius
  155. -moz-border-radius-topleft: $radius
  156. -moz-border-radius-bottomleft: $radius
  157. border-top-left-radius: $radius
  158. border-bottom-left-radius: $radius
  159. //
  160. // BOX SHADOWS
  161. //
  162. // @include box-shadow(5px, 5px, 10px, #000);
  163. @mixin box-shadow ($shadow-1, $shadow-2: false, $shadow-3: false, $shadow-4: false, $shadow-5: false, $shadow-6: false, $shadow-7: false, $shadow-8: false, $shadow-9: false)
  164. $full: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9)
  165. -webkit-box-shadow: $full
  166. -moz-box-shadow: $full
  167. -ms-box-shadow: $full
  168. -o-box-shadow: $full
  169. box-shadow: $full
  170. //
  171. // CSS3 GRADIENTS
  172. // Be careful with these since they can
  173. // really slow down your CSS. Don't overdue it.
  174. //
  175. // @include css-gradient(#dfdfdf,#f8f8f8);
  176. @mixin css-gradient($from: #dfdfdf, $to: #f8f8f8)
  177. background-color: $to
  178. background-image: -webkit-gradient(linear, left top, left bottom, from($from), to($to))
  179. background-image: -webkit-linear-gradient(top, $from, $to)
  180. background-image: -moz-linear-gradient(top, $from, $to)
  181. background-image: -o-linear-gradient(top, $from, $to)
  182. background-image: -ms-linear-gradient(top, $from, $to)
  183. background-image: linear-gradient(top, $from, $to)
  184. //
  185. // BOX SIZING
  186. //
  187. // @include boxSizing(border-box);
  188. @mixin boxSizing($type: border-box)
  189. -webkit-box-sizing: $type
  190. -moz-box-sizing: $type
  191. -ms-box-sizing: $type
  192. -o-box-sizing: $type
  193. box-sizing: $type
  194. //
  195. // BOX SHADOW
  196. //
  197. // @include boxShadow(0 0 4px #444);
  198. @mixin boxShadow($x: 0, $y: 0, $radius: 4px, $spread: 0, $color: rgba(0,0,0,0.5))
  199. -webkit-box-shadow: $x $y $radius $spread $color
  200. -moz-box-shadow: $x $y $radius $spread $color
  201. -ms-box-shadow: $x $y $radius $spread $color
  202. -o-box-shadow: $x $y $radius $spread $color
  203. box-shadow: $x $y $radius $spread $color
  204. //
  205. // BUTTONS
  206. //
  207. .button, .button:visited
  208. border: 1px solid darken($blue, 13%)
  209. border-top-color: darken($blue, 7%)
  210. border-left-color: darken($blue, 7%)
  211. padding: 4px 12px
  212. color: $white
  213. display: inline-block
  214. font-size: 11px
  215. font-weight: bold
  216. text-decoration: none
  217. text-shadow: 0 1px rgba(0,0,0, .75)
  218. cursor: pointer
  219. margin-bottom: 20px
  220. line-height: 21px
  221. @include borderRadius(4px)
  222. @include css-gradient($blue,darken($blue, 5%))
  223. &:hover, &:focus
  224. color: $white
  225. border: 1px solid darken($blue, 13%)
  226. border-top-color: darken($blue, 20%)
  227. border-left-color: darken($blue, 20%)
  228. @include css-gradient(darken($blue, 5%),darken($blue, 10%))
  229. &:active
  230. @include css-gradient(darken($blue, 5%),$blue)