_mixins.scss 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. $alert-yellow: #ebe16f;
  44. $alert-red: #fbe3e4;
  45. $alert-green: #e6efc2;
  46. $alert-blue: #d5edf8;
  47. $black: #000;
  48. $white: #fff;
  49. $bones-pink: #f01d4f;
  50. $bones-blue: #1990db;
  51. $link-color: $bones-pink;
  52. $link-hover: lighten($bones-pink, 9%);
  53. /*********************
  54. TYPOGRAPHY
  55. *********************/
  56. $sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  57. $serif: "Georgia", Cambria, Times New Roman, Times, serif;
  58. /* To embed your own fonts, use this syntax
  59. and place your fonts inside the
  60. library/fonts folder. For more information
  61. on embedding fonts, go to:
  62. http://www.fontsquirrel.com/
  63. Be sure to remove the comment brackets.
  64. */
  65. /* @font-face {
  66. font-family: 'Font Name';
  67. src: url('library/fonts/font-name.eot');
  68. src: url('library/fonts/font-name.eot?#iefix') format('embedded-opentype'),
  69. url('library/fonts/font-name.woff') format('woff'),
  70. url('library/fonts/font-name.ttf') format('truetype'),
  71. url('library/fonts/font-name.svg#font-name') format('svg');
  72. font-weight: normal;
  73. font-style: normal;
  74. }
  75. */
  76. /*
  77. use the best ampersand
  78. http://simplebits.com/notebook/2008/08/14/ampersands-2/
  79. */
  80. span.amp {
  81. font-family: Baskerville,'Goudy Old Style',Palatino,'Book Antiqua',serif !important;
  82. font-style: italic;
  83. }
  84. /* text alignment */
  85. .text-left { text-align: left; }
  86. .text-center { text-align: center; }
  87. .text-right { text-align: right; }
  88. /* alerts & notices */
  89. %alert {
  90. margin: 10px;
  91. padding: 5px 18px;
  92. border: 1px solid;
  93. }
  94. .alert-help {
  95. @extend %alert;
  96. border-color: darken($alert-yellow, 5%);
  97. background: $alert-yellow;
  98. }
  99. .alert-info {
  100. @extend %alert;
  101. border-color: darken($alert-blue, 5%);
  102. background: $alert-blue;
  103. }
  104. .alert-error {
  105. @extend %alert;
  106. border-color: darken($alert-red, 5%);
  107. background: $alert-red;
  108. }
  109. .alert-success {
  110. @extend %alert;
  111. border-color: darken($alert-green, 5%);
  112. background: $alert-green;
  113. }
  114. /*********************
  115. BORDER RADIUS
  116. *********************/
  117. /*
  118. NOTE: For older browser support (and some mobile),
  119. don't use the shorthand to define *different* corners.
  120. USAGE: @include rounded(4px);
  121. */
  122. @mixin rounded($radius: 4px) {
  123. -webkit-border-radius: $radius;
  124. -moz-border-radius: $radius;
  125. border-radius: $radius;
  126. }
  127. /*
  128. Instead of having a seperate mixin for the different
  129. borders, we're using the mixin from 320 & Up to make
  130. things easier to use.
  131. USAGE: @include border-radius(4px,4px,0,0);
  132. */
  133. @mixin border-radius($topright: 0, $bottomright: 0, $bottomleft: 0, $topleft: 0) {
  134. -webkit-border-top-right-radius: $topright;
  135. -webkit-border-bottom-right-radius: $bottomright;
  136. -webkit-border-bottom-left-radius: $bottomleft;
  137. -webkit-border-top-left-radius: $topleft;
  138. -moz-border-radius-topright: $topright;
  139. -moz-border-radius-bottomright: $bottomright;
  140. -moz-border-radius-bottomleft: $bottomleft;
  141. -moz-border-radius-topleft: $topleft;
  142. border-top-right-radius: $topright;
  143. border-bottom-right-radius: $bottomright;
  144. border-bottom-left-radius: $bottomleft;
  145. border-top-left-radius: $topleft;
  146. -webkit-background-clip: padding-box;
  147. -moz-background-clip: padding;
  148. background-clip: padding-box;
  149. }
  150. /*********************
  151. TRANISTION
  152. *********************/
  153. /* @include transition(all,2s,ease-out); */
  154. @mixin css-transition($what: all, $time: 0.2s, $how: ease-in-out) {
  155. -webkit-transition: $what $time $how;
  156. -moz-transition: $what $time $how;
  157. -ms-transition: $what $time $how;
  158. -o-transition: $what $time $how;
  159. transition: $what $time $how;
  160. }
  161. /*********************
  162. BOX SHADOWS
  163. *********************/
  164. /* @include box-shadow(5px, 5px, 10px, #000); */
  165. @mixin box-shadow($shadow-1,
  166. $shadow-2: false, $shadow-3: false,
  167. $shadow-4: false, $shadow-5: false,
  168. $shadow-6: false, $shadow-7: false,
  169. $shadow-8: false, $shadow-9: false) {
  170. $full: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9);
  171. -webkit-box-shadow: $full;
  172. -moz-box-shadow: $full;
  173. box-shadow: $full;
  174. }
  175. /*********************
  176. CSS3 GRADIENTS
  177. Be careful with these since they can
  178. really slow down your CSS. Don't overdue it.
  179. *********************/
  180. /* @include css-gradient(#dfdfdf,#f8f8f8); */
  181. @mixin css-gradient($from: #dfdfdf, $to: #f8f8f8) {
  182. background-color: $to;
  183. background-image: -webkit-gradient(linear, left top, left bottom, from($from), to($to));
  184. background-image: -webkit-linear-gradient(top, $from, $to);
  185. background-image: -moz-linear-gradient(top, $from, $to);
  186. background-image: -o-linear-gradient(top, $from, $to);
  187. background-image: linear-gradient(to bottom, $from, $to);
  188. }
  189. /*********************
  190. BOX SIZING
  191. *********************/
  192. /* @include box-sizing(border-box); */
  193. /* NOTE: value of "padding-box" is only supported in Gecko. So
  194. probably best not to use it. I mean, were you going to anyway? */
  195. @mixin box-sizing($type: border-box) {
  196. -webkit-box-sizing: $type;
  197. -moz-box-sizing: $type;
  198. -ms-box-sizing: $type;
  199. box-sizing: $type;
  200. }
  201. /*********************
  202. BUTTONS
  203. *********************/
  204. .button, .button:visited {
  205. font-family: $sans-serif;
  206. border: 1px solid darken($link-color, 13%);
  207. border-top-color: darken($link-color, 7%);
  208. border-left-color: darken($link-color, 7%);
  209. padding: 4px 12px;
  210. color: $white;
  211. display: inline-block;
  212. font-size: 11px;
  213. font-weight: bold;
  214. text-decoration: none;
  215. text-shadow: 0 1px rgba(0,0,0, .75);
  216. cursor: pointer;
  217. margin-bottom: 20px;
  218. line-height: 21px;
  219. @include rounded(4px);
  220. @include css-gradient($link-color, darken($link-color, 5%));
  221. &:hover, &:focus {
  222. color: $white;
  223. border: 1px solid darken($link-color, 13%);
  224. border-top-color: darken($link-color, 20%);
  225. border-left-color: darken($link-color, 20%);
  226. @include css-gradient(darken($link-color, 5%), darken($link-color, 10%));
  227. }
  228. &:active {
  229. @include css-gradient(darken($link-color, 5%), $link-color);
  230. }
  231. }
  232. .blue-button, .blue-button:visited {
  233. border-color: darken($bones-blue, 10%);
  234. text-shadow: 0 1px 1px darken($bones-blue, 10%);
  235. @include css-gradient( $bones-blue, darken($bones-blue, 5%) );
  236. -webkit-box-shadow: inset 0 0 3px lighten($bones-blue, 16%);
  237. -moz-box-shadow: inset 0 0 3px lighten($bones-blue, 16%);
  238. box-shadow: inset 0 0 3px lighten($bones-blue, 16%);
  239. &:hover, &:focus {
  240. border-color: darken($bones-blue, 15%);
  241. @include css-gradient( darken($bones-blue, 4%), darken($bones-blue, 10%) );
  242. }
  243. &:active {
  244. @include css-gradient( darken($bones-blue, 5%), $bones-blue );
  245. }
  246. }