mixins.less 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /******************************************************************
  2. Site Name:
  3. Author:
  4. Stylesheet: Mixins & Constants Stylesheet
  5. This is where you can take advantage of LESS' 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. /* for IE */
  28. zoom: 1;
  29. }
  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. /*********************
  40. COLORS
  41. Need help w/ choosing your colors? Try this site out:
  42. http://0to255.com/
  43. *********************/
  44. @yellow: #ebe16f;
  45. @red: #fbe3e4;
  46. @green: #e6efc2;
  47. @blue: #d5edf8;
  48. @black: #000;
  49. @white: #fff;
  50. @bones-pink: #f01d4f;
  51. @bones-blue: #1990db;
  52. /*********************
  53. TYPOGRAPHY
  54. *********************/
  55. @sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  56. @serif: "Georgia", Cambria, Times New Roman, Times, serif;
  57. /* To embed your own fonts, use this syntax
  58. and place your fonts inside the
  59. library/fonts folder. For more information
  60. on embedding fonts, go to:
  61. http://www.fontsquirrel.com/
  62. Be sure to remove the comment brackets.
  63. */
  64. /* @font-face {
  65. font-family: 'Font Name';
  66. src: url('../fonts/font-name.eot');
  67. src: url('../fonts/font-name.eot?#iefix') format('embedded-opentype'),
  68. url('../fonts/font-name.woff') format('woff'),
  69. url('../fonts/font-name.ttf') format('truetype'),
  70. url('../fonts/font-name.svg#font-name') format('svg');
  71. font-weight: normal;
  72. font-style: normal;
  73. }
  74. */
  75. /*
  76. use the best ampersand
  77. http://simplebits.com/notebook/2008/08/14/ampersands-2/
  78. */
  79. span.amp {
  80. font-family: Baskerville,'Goudy Old Style',Palatino,'Book Antiqua',serif;
  81. font-style: italic;
  82. }
  83. /* text alignment */
  84. .text-left { text-align: left; }
  85. .text-center { text-align: center; }
  86. .text-right { text-align: right; }
  87. /* alerts & notices */
  88. .alert {
  89. margin: 10px;
  90. padding: 5px 18px;
  91. border: 1px solid;
  92. }
  93. .help {
  94. border-color: darken(@yellow, 5%);
  95. background: @yellow;
  96. }
  97. .info {
  98. border-color: darken(@blue, 5%);
  99. background: @blue;
  100. }
  101. .error {
  102. border-color: darken(@red, 5%);
  103. background: @red;
  104. }
  105. .success {
  106. border-color: darken(@green, 5%);
  107. background: @green;
  108. }
  109. /*********************
  110. BORDER RADIUS
  111. *********************/
  112. /* .rounded(4px); */
  113. .rounded(@radius: 4px) {
  114. -webkit-border-radius: @radius;
  115. -moz-border-radius: @radius;
  116. -ms-border-radius: @radius;
  117. -o-border-radius: @radius;
  118. border-radius: @radius;
  119. }
  120. /* .rounded-left(4px); */
  121. .rounded-left(@radius: 4px) {
  122. -webkit-border-bottom-left-radius: @radius;
  123. -webkit-border-top-left-radius: @radius;
  124. -moz-border-radius-bottomleft: @radius;
  125. -moz-border-radius-topleft: @radius;
  126. border-bottom-left-radius: @radius;
  127. border-top-left-radius: @radius;
  128. }
  129. /* .rounded-right(4px); */
  130. .rounded-right(@radius: 4px) {
  131. -webkit-border-bottom-right-radius: @radius;
  132. -webkit-border-top-right-radius: @radius;
  133. -moz-border-radius-bottomright: @radius;
  134. -moz-border-radius-topright: @radius;
  135. border-bottom-right-radius: @radius;
  136. border-top-right-radius: @radius;
  137. }
  138. /* .rounded-bottom(4px); */
  139. .rounded-bottom(@radius: 4px) {
  140. -webkit-border-bottom-right-radius: @radius;
  141. -webkit-border-bottom-left-radius: @radius;
  142. -moz-border-radius-bottomright: @radius;
  143. -moz-border-radius-bottomleft: @radius;
  144. border-bottom-right-radius: @radius;
  145. border-bottom-left-radius: @radius;
  146. }
  147. /* .rounded-top(4px); */
  148. .rounded-top(@radius: 4px) {
  149. -webkit-border-top-right-radius: @radius;
  150. -webkit-border-top-left-radius: @radius;
  151. -moz-border-radius-topright: @radius;
  152. -moz-border-radius-topleft: @radius;
  153. border-top-right-radius: @radius;
  154. border-top-left-radius: @radius;
  155. }
  156. /*********************
  157. TRANISTION
  158. *********************/
  159. /* .transition(all,2s); */
  160. .transition(@what: all, @time: 0.2s) {
  161. -webkit-transition: @what @time ease-out;
  162. -moz-transition: @what @time ease-out;
  163. -ms-transition: @what @time ease-out;
  164. -o-transition: @what @time ease-out;
  165. transition: @what @time ease-out;
  166. }
  167. /*********************
  168. CSS3 GRADIENTS
  169. Be careful with these since they can
  170. really slow down your CSS. Don't overdue it.
  171. *********************/
  172. /* .css-gradient(#dfdfdf,#f8f8f8); */
  173. .css-gradient(@from: #dfdfdf, @to: #f8f8f8) {
  174. background-color: @to;
  175. background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
  176. background-image: -webkit-linear-gradient(top, @from, @to);
  177. background-image: -moz-linear-gradient(top, @from, @to);
  178. background-image: -o-linear-gradient(top, @from, @to);
  179. background-image: -ms-linear-gradient(top, @from, @to);
  180. background-image: linear-gradient(top, @from, @to);
  181. }
  182. /*********************
  183. BOX SIZING
  184. *********************/
  185. /* .boxSizing(border-box); */
  186. .boxSizing(@type: border-box) {
  187. -webkit-box-sizing: @type;
  188. -moz-box-sizing: @type;
  189. -ms-box-sizing: @type;
  190. -o-box-sizing: @type;
  191. box-sizing: @type;
  192. }
  193. /*********************
  194. BOX SHADOW
  195. *********************/
  196. /* .boxShadow(0 0 4px #444); */
  197. .boxShadow(@x: 0, @y: 0, @radius: 4px, @spread: 0, @color: rgba(0,0,0,0.5)) {
  198. -webkit-box-shadow: @x @y @radius @spread @color;
  199. -moz-box-shadow: @x @y @radius @spread @color;
  200. -ms-box-shadow: @x @y @radius @spread @color;
  201. -o-box-shadow: @x @y @radius @spread @color;
  202. box-shadow: @x @y @radius @spread @color;
  203. }
  204. /*********************
  205. BUTTONS
  206. *********************/
  207. .button, .button:visited {
  208. border: 1px solid darken(@bones-pink, 13%);
  209. border-top-color: darken(@bones-pink, 7%);
  210. border-left-color: darken(@bones-pink, 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. .transition();
  222. .borderRadius(4px);
  223. .css-gradient(@bones-pink,darken(@bones-pink, 5%));
  224. &:hover, &:focus {
  225. color: @white;
  226. border: 1px solid darken(@bones-pink, 13%);
  227. border-top-color: darken(@bones-pink, 20%);
  228. border-left-color: darken(@bones-pink, 20%);
  229. .css-gradient(darken(@bones-pink, 5%),darken(@bones-pink, 10%));
  230. }
  231. &:active {
  232. .css-gradient(darken(@bones-pink, 5%),@bones-pink);
  233. }
  234. }
  235. .blue-button, .blue-button:visited {
  236. border-color: darken(@bones-blue, 10%);
  237. text-shadow: 0 1px 1px darken(@bones-blue, 10%);
  238. @include css-gradient( @bones-blue, darken(@bones-blue, 5%) );
  239. -webkit-box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  240. -moz-box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  241. box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  242. &:hover, &:focus {
  243. border-color: darken(@bones-blue, 15%);
  244. @include css-gradient( darken(@bones-blue, 4%), darken(@bones-blue, 10%) );
  245. }
  246. &:active {
  247. @include css-gradient( darken(@bones-blue, 5%), @bones-blue );
  248. }
  249. }