mixins.scss 7.7 KB

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