mixins.less 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. @alert-yellow: #ebe16f;
  45. @alert-red: #fbe3e4;
  46. @alert-green: #e6efc2;
  47. @alert-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(@alert-yellow, 5%);
  95. background: @alert-yellow;
  96. }
  97. .info {
  98. border-color: darken(@alert-blue, 5%);
  99. background: @alert-blue;
  100. }
  101. .error {
  102. border-color: darken(@alert-red, 5%);
  103. background: @alert-red;
  104. }
  105. .success {
  106. border-color: darken(@alert-green, 5%);
  107. background: @alert-green;
  108. }
  109. /*********************
  110. BORDER RADIUS
  111. *********************/
  112. /*
  113. NOTE: For older browser support (and some mobile),
  114. don't use the shorthand to define *different* corners.
  115. USAGE: .rounded(4px);
  116. */
  117. .rounded(@radius: 4px) {
  118. -webkit-border-radius: @radius;
  119. -moz-border-radius: @radius;
  120. border-radius: @radius;
  121. }
  122. /*
  123. Instead of having a seperate mixin for the different
  124. borders, we're using the mixin from 320 & Up to make
  125. things easier to use.
  126. USAGE: .border-radius(4px,4px,0,0);
  127. */
  128. .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
  129. -webkit-border-top-right-radius: @topright;
  130. -webkit-border-bottom-right-radius: @bottomright;
  131. -webkit-border-bottom-left-radius: @bottomleft;
  132. -webkit-border-top-left-radius: @topleft;
  133. -moz-border-radius-topright: @topright;
  134. -moz-border-radius-bottomright: @bottomright;
  135. -moz-border-radius-bottomleft: @bottomleft;
  136. -moz-border-radius-topleft: @topleft;
  137. border-top-right-radius: @topright;
  138. border-bottom-right-radius: @bottomright;
  139. border-bottom-left-radius: @bottomleft;
  140. border-top-left-radius: @topleft;
  141. -webkit-background-clip: padding-box;
  142. -moz-background-clip: padding;
  143. background-clip: padding-box;
  144. }
  145. /*********************
  146. TRANISTION
  147. *********************/
  148. /* .transition(all,2s); */
  149. .transition(@what: all, @time: 0.2s, @transition: ease-in-out) {
  150. -webkit-transition: @what @time @transition;
  151. -moz-transition: @what @time @transition;
  152. -ms-transition: @what @time @transition;
  153. -o-transition: @what @time @transition;
  154. transition: @what @time @transition;
  155. }
  156. /*********************
  157. CSS3 GRADIENTS
  158. Be careful with these since they can
  159. really slow down your CSS. Don't overdo it.
  160. *********************/
  161. /* .css-gradient(#dfdfdf,#f8f8f8); */
  162. .css-gradient(@from: #dfdfdf, @to: #f8f8f8) {
  163. background-color: @to;
  164. background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
  165. background-image: -webkit-linear-gradient(top, @from, @to);
  166. background-image: -moz-linear-gradient(top, @from, @to);
  167. background-image: -o-linear-gradient(top, @from, @to);
  168. background-image: linear-gradient(to bottom, @from, @to);
  169. }
  170. /*********************
  171. BOX SIZING
  172. *********************/
  173. /* .boxSizing(border-box); */
  174. /* NOTE: value of "padding-box" is only supported in Gecko. So
  175. probably best not to use it. I mean, were you going to anyway? */
  176. .boxSizing(@type: border-box) {
  177. -webkit-box-sizing: @type;
  178. -moz-box-sizing: @type;
  179. -ms-box-sizing: @type;
  180. box-sizing: @type;
  181. }
  182. /*********************
  183. BOX SHADOW
  184. *********************/
  185. /* .boxShadow(0,0,4px,#444); */
  186. .boxShadow(@x: 0, @y: 0, @radius: 4px, @spread: 0, @color: rgba(0,0,0,0.5)) {
  187. -webkit-box-shadow: @x @y @radius @spread @color;
  188. -moz-box-shadow: @x @y @radius @spread @color;
  189. box-shadow: @x @y @radius @spread @color;
  190. }
  191. /*********************
  192. BUTTONS
  193. *********************/
  194. .button, .button:visited {
  195. border: 1px solid darken(@bones-pink, 13%);
  196. border-top-color: darken(@bones-pink, 7%);
  197. border-left-color: darken(@bones-pink, 7%);
  198. padding: 4px 12px;
  199. color: @white;
  200. display: inline-block;
  201. font-size: 11px;
  202. font-weight: bold;
  203. text-decoration: none;
  204. text-shadow: 0 1px rgba(0,0,0, .75);
  205. cursor: pointer;
  206. margin-bottom: 20px;
  207. line-height: 21px;
  208. .transition();
  209. .rounded(4px);
  210. .css-gradient(@bones-pink,darken(@bones-pink, 5%));
  211. &:hover, &:focus {
  212. color: @white;
  213. border: 1px solid darken(@bones-pink, 13%);
  214. border-top-color: darken(@bones-pink, 20%);
  215. border-left-color: darken(@bones-pink, 20%);
  216. .css-gradient(darken(@bones-pink, 5%),darken(@bones-pink, 10%));
  217. }
  218. &:active {
  219. .css-gradient(darken(@bones-pink, 5%),@bones-pink);
  220. }
  221. }
  222. .blue-button, .blue-button:visited {
  223. border-color: darken(@bones-blue, 10%);
  224. text-shadow: 0 1px 1px darken(@bones-blue, 10%);
  225. .css-gradient( @bones-blue, darken(@bones-blue, 5%) );
  226. -webkit-box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  227. -moz-box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  228. box-shadow: inset 0 0 3px lighten(@bones-blue, 16%);
  229. &:hover, &:focus {
  230. border-color: darken(@bones-blue, 15%);
  231. .css-gradient( darken(@bones-blue, 4%), darken(@bones-blue, 10%) );
  232. }
  233. &:active {
  234. .css-gradient( darken(@bones-blue, 5%), @bones-blue );
  235. }
  236. }