moka.less 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. @import "reset.css";
  2. @import url("http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,latin-ext");
  3. // Mixins
  4. .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
  5. background: @color;
  6. background: -webkit-gradient(linear,
  7. left bottom,
  8. left top,
  9. color-stop(0, @start),
  10. color-stop(1, @stop));
  11. background: -ms-linear-gradient(bottom,
  12. @start,
  13. @stop);
  14. background: -moz-linear-gradient(center bottom,
  15. @start 0%,
  16. @stop 100%);
  17. background: -o-linear-gradient(@stop,
  18. @start);
  19. }
  20. .vertical-gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
  21. background: @color;
  22. background: -webkit-gradient(linear,
  23. left top,
  24. right top,
  25. color-stop(0, @start),
  26. color-stop(1, @stop));
  27. background: -ms-linear-gradient(left,
  28. @start,
  29. @stop);
  30. background: -moz-linear-gradient(right,
  31. @start 0%,
  32. @stop 100%);
  33. }
  34. .linear-gradient(@arguments) {
  35. background: -webkit-linear-gradient(@arguments);
  36. background: -moz-linear-gradient(@arguments);
  37. background: -ms-linear-gradient(@arguments);
  38. background: -o-linear-gradient(@arguments);
  39. background: linear-gradient(@arguments);
  40. }
  41. .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
  42. border-top: solid 1px @top-color;
  43. border-left: solid 1px @left-color;
  44. border-right: solid 1px @right-color;
  45. border-bottom: solid 1px @bottom-color;
  46. }
  47. .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
  48. -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  49. -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  50. box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  51. }
  52. .rounded(@radius: 3px) {
  53. -webkit-border-radius: @radius;
  54. -moz-border-radius: @radius;
  55. border-radius: @radius;
  56. }
  57. .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
  58. -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  59. -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  60. box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  61. }
  62. .box-shadow(@arguments) {
  63. -webkit-box-shadow: @arguments;
  64. -moz-box-shadow: @arguments;
  65. box-shadow: @arguments;
  66. }
  67. .transition(@property: all, @duration:0.2s, @ease:ease-out) {
  68. -webkit-transition: @property @duration @ease;
  69. -moz-transition: @property @duration @ease;
  70. -o-transition: @property @duration @ease;
  71. transition: @property @duration @ease;
  72. }
  73. .no-select {
  74. -webkit-touch-callout: none;
  75. -webkit-user-select: none;
  76. -khtml-user-select: none;
  77. -moz-user-select: none;
  78. -ms-user-select: none;
  79. user-select: none;
  80. }
  81. // Moka definitions
  82. // Variables
  83. @blue: #4a90d9;
  84. @lightblue: #E9ECFA;
  85. @lighter: #f1f1f1;
  86. @light: #eee;
  87. @grey: #aaa;
  88. @dark: #888;
  89. @darker: #444;
  90. @verydark: #333;
  91. // scrollbars
  92. ::-webkit-scrollbar {
  93. width: 8px;
  94. height: 8px;
  95. }
  96. ::-webkit-scrollbar-button {
  97. height: 0;
  98. width: 0;
  99. }
  100. ::-webkit-resizer {
  101. background-color: @light;
  102. }
  103. ::-webkit-scrollbar-track {
  104. background-color: @light;
  105. }
  106. ::-webkit-scrollbar-track-piece {
  107. background-color: @light;
  108. }
  109. ::-webkit-scrollbar-corner {
  110. background-color: @light
  111. }
  112. ::-webkit-scrollbar-thumb {
  113. .vertical-gradient(darken(@light, 5%), darken(@light, 5%), darken(@light, 12%));
  114. border: 1px solid darken(@light, 35%);
  115. .rounded(8px);
  116. &:hover {
  117. .vertical-gradient(lighten(@grey, 10%), lighten(@grey, 10%), @grey);
  118. border: 1px solid darken(@grey, 10%);
  119. }
  120. }
  121. // mixins
  122. .mk_default {
  123. // Generic fonts
  124. font-size: 12px;
  125. font-family: "Open Sans";
  126. line-height: 1.5em;
  127. color: @darker;
  128. text-shadow: 0 1px 0 white;
  129. // no padding or margin
  130. padding: 0;
  131. margin: 0;
  132. }
  133. .mk_absolute {
  134. position: absolute;
  135. display: block;
  136. overflow: hidden;
  137. }
  138. .mk_overlay {
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. right: 0;
  143. bottom: 0;
  144. zindex: 1000;
  145. background: transparent;
  146. }
  147. .moka_view {
  148. .mk_absolute;
  149. // Labels & headings
  150. &.mk_label {
  151. .mk_default;
  152. color: @verydark;
  153. padding: 4px;
  154. &.mk_heading {
  155. font-weight: bold;
  156. &.level1 {
  157. font-size: 2em;
  158. }
  159. &.level2 {
  160. font-size: 1.8em;
  161. }
  162. &.level3 {
  163. font-size: 1.6em;
  164. }
  165. &.level4 {
  166. font-size: 1.4em;
  167. }
  168. &.level5 {
  169. font-size: 1.2em;
  170. }
  171. }
  172. }
  173. // Panes
  174. &.mk_pane {
  175. &.mk_panel {
  176. background: @light;
  177. border-color: @dark;
  178. border-style: solid;
  179. overflow: auto;
  180. }
  181. &.mk_modal {
  182. z-index: 1001;
  183. background: transparent;
  184. border: 0 none;
  185. &:focus {
  186. outline: 0 none;
  187. }
  188. }
  189. }
  190. // Controls
  191. .mk_control, .mk_control:active, .mk_control:focus {
  192. .mk_default;
  193. .mk_absolute;
  194. .rounded();
  195. border: 1px solid @grey;
  196. .box-shadow(inset 0 0 3px 0 lighten(@grey, 10%));
  197. background-color: white;
  198. // see http://stackoverflow.com/questions/14768780/how-can-i-pass-mixin-arguments-along-literally-in-less-css
  199. .linear-gradient(~"top, #eee 0%, white 6px");
  200. &:focus {
  201. outline: 0;
  202. }
  203. }
  204. &.mk_button {
  205. .mk_control;
  206. .no-select;
  207. .box-shadow(0 1px 1px 0 lighten(@grey, 18%));
  208. .gradient(#fafafa, #dedede, white);
  209. &.default {
  210. .gradient(lighten(@blue, 20%), lighten(@blue, 20%), lighten(@blue, 35%));
  211. border-color: darken(@grey, 5%);
  212. &:active {
  213. background: lighten(@blue, 20%);
  214. border-color: @blue;
  215. }
  216. }
  217. &:focus {
  218. border-color: @blue;
  219. }
  220. &:active {
  221. background: lighten(@grey, 20%);
  222. .box-shadow(inset 0 0 3px 0 @dark);
  223. border-color: saturate(@dark, 10%);
  224. }
  225. }
  226. &.mk_input, &.mk_textarea {
  227. .mk_control;
  228. resize: none;
  229. padding: 0 4px;
  230. text-shadow: 0 0 0;
  231. &:focus {
  232. .box-shadow(inset 0 0 3px 0 @dark);
  233. border-color: @blue;
  234. }
  235. }
  236. &.mk_checkbox {
  237. .no-select;
  238. background: url('../images/moka/check.png') 50% 50% no-repeat;
  239. height: 16px;
  240. width: 16px;
  241. &:focus {
  242. outline: 0;
  243. }
  244. &.checked {
  245. background-image: url('../images/moka/check-active.png');
  246. }
  247. }
  248. &.mk_switch {
  249. .no-select;
  250. .rounded(20px);
  251. vertical-align: middle;
  252. display: inline-block;
  253. height: 20px;
  254. width: 39px;
  255. border: 1px solid @dark;
  256. background: url('../images/moka/switch.png') 100% 50% no-repeat;
  257. .transition(background, .2s);
  258. &:focus {
  259. border-color: darken(@blue, 15%);
  260. }
  261. &.checked {
  262. background: url('../images/moka/switch.png') 0% 50% no-repeat;
  263. border-color: darken(@blue, 5%);
  264. }
  265. }
  266. // Lists
  267. &.mk_list {
  268. cursor: default;
  269. .mk_default;
  270. .no-select;
  271. .mk_control;
  272. padding: 0;
  273. overflow: auto;
  274. background: white;
  275. &:focus {
  276. outline: 0;
  277. border-color: @blue;
  278. li.selected {
  279. background: lighten(@blue, 10%);
  280. color: white;
  281. }
  282. }
  283. li {
  284. line-height: 2em;
  285. padding: 0 4px;
  286. text-shadow: 0 0 0;
  287. &.selected {
  288. background: lighten(@grey, 20%);
  289. }
  290. }
  291. &.mk_sourcelist {
  292. background: transparent;
  293. border: 0;
  294. .rounded(0);
  295. .box-shadow(0 0 0);
  296. li {
  297. border-top: 1px solid transparent;
  298. border-bottom: 1px solid transparent;
  299. padding: 0 14px;
  300. }
  301. &:focus li.selected, li.selected {
  302. text-shadow: 0 1px 0 @verydark;
  303. .gradient(lighten(@blue, 10%), lighten(@blue, 10%), lighten(@blue, 20%));
  304. border-top: 1px solid @blue;
  305. border-bottom: 1px solid @blue;
  306. color: white;
  307. font-weight: bold;
  308. }
  309. }
  310. }
  311. // Dropdowns
  312. &.mk_dropdown {
  313. .mk_button;
  314. text-align: left;
  315. padding: 0 8px;
  316. .mk_dropdown_arrows {
  317. position: absolute;
  318. right: 0;
  319. height: 100%;
  320. width: 24px;
  321. top: 0;
  322. background-image: url(/images/moka/dropdown_arrows.png);
  323. background-position: center;
  324. background-repeat: no-repeat;
  325. border-left: 1px solid @grey;
  326. }
  327. }
  328. &.mk_dropdown_pane {
  329. padding: 6px;
  330. margin-left: -6px;
  331. margin-top: -6px;
  332. .mk_dropdown_list {
  333. position: relative;
  334. display: inline-block;
  335. border: 0;
  336. background: white;
  337. .box-shadow(0 0 6px darken(@dark, 20%));
  338. .rounded(0);
  339. min-width: 120px;
  340. max-height: 400px;
  341. li {
  342. padding: 0 6px;
  343. &.selected {
  344. background: @blue;
  345. color: white;
  346. };
  347. }
  348. &:focus {
  349. border: 0;
  350. }
  351. }
  352. }
  353. }