_mixins.scss 8.7 KB

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