moka.less 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. // mixins
  92. .mk_default {
  93. // Generic fonts
  94. font-size: 12px;
  95. font-family: "Open Sans";
  96. line-height: 1.5em;
  97. color: @darker;
  98. text-shadow: 0 1px 0 white;
  99. // no padding or margin
  100. padding: 0;
  101. margin: 0;
  102. }
  103. .mk_absolute {
  104. position: absolute;
  105. display: block;
  106. overflow: hidden;
  107. }
  108. .mk_overlay {
  109. position: fixed;
  110. top: 0;
  111. left: 0;
  112. right: 0;
  113. bottom: 0;
  114. zindex: 1000;
  115. background: transparent;
  116. }
  117. .moka_view {
  118. .mk_absolute;
  119. // Labels & headings
  120. &.mk_label {
  121. .mk_default;
  122. color: @verydark;
  123. padding: 4px;
  124. &.mk_heading {
  125. font-weight: bold;
  126. &.level1 {
  127. font-size: 2em;
  128. }
  129. &.level2 {
  130. font-size: 1.8em;
  131. }
  132. &.level3 {
  133. font-size: 1.6em;
  134. }
  135. &.level4 {
  136. font-size: 1.4em;
  137. }
  138. &.level5 {
  139. font-size: 1.2em;
  140. }
  141. }
  142. }
  143. // Panes
  144. &.mk_pane {
  145. &.mk_panel {
  146. background: @light;
  147. border-color: @dark;
  148. border-style: solid;
  149. }
  150. &.mk_modal {
  151. z-index: 1001;
  152. background: transparent;
  153. border: 0 none;
  154. &:focus {
  155. outline: 0 none;
  156. }
  157. }
  158. }
  159. // Scrollbars
  160. &.mk_scroll {
  161. .mk_scroll_rail {
  162. position: absolute;
  163. z-index: 1;
  164. .mk_scrollbar {
  165. position: absolute;
  166. .rounded(8px);
  167. .transition(background, 0.2s);
  168. opacity: 0.6;
  169. &:hover, &.ui-draggable-dragging {
  170. background: @verydark;
  171. }
  172. }
  173. &.vertical {
  174. top: 0;
  175. right: 0;
  176. bottom: 0;
  177. width: 10px;
  178. .mk_scrollbar {
  179. width: 8px;
  180. }
  181. }
  182. &.horizontal {
  183. bottom: 0;
  184. left: 0;
  185. right: 0;
  186. height: 10px;
  187. .mk_scrollbar {
  188. height: 8px;
  189. }
  190. }
  191. }
  192. &:hover {
  193. .mk_scrollbar {
  194. background: rgba(0,0,0,0.4);
  195. }
  196. }
  197. }
  198. // Controls
  199. .mk_control, .mk_control:active, .mk_control:focus {
  200. .mk_default;
  201. .mk_absolute;
  202. .rounded();
  203. border: 1px solid darken(@grey, 10%);
  204. .box-shadow(inset 0 0 3px 0 lighten(@grey, 10%));
  205. background-color: white;
  206. // see http://stackoverflow.com/questions/14768780/how-can-i-pass-mixin-arguments-along-literally-in-less-css
  207. .linear-gradient(~"top, #eee 0%, white 6px");
  208. &:focus {
  209. outline: 0;
  210. }
  211. &::-moz-focus-inner {
  212. border: 0;
  213. }
  214. }
  215. &.mk_button {
  216. .mk_control;
  217. .no-select;
  218. .box-shadow(0 1px 1px 0 lighten(@grey, 18%));
  219. .gradient(#fafafa, #dedede, white);
  220. &.default {
  221. .gradient(lighten(@blue, 20%), lighten(@blue, 20%), lighten(@blue, 35%));
  222. text-shadow: 0 1px 0 @light;
  223. &:active {
  224. background: lighten(@blue, 20%);
  225. border-color: @blue;
  226. }
  227. }
  228. &:focus {
  229. border-color: @blue;
  230. box-shadow: 0 0 5px @blue;
  231. }
  232. &:active {
  233. background: lighten(@grey, 20%);
  234. .box-shadow(inset 0 0 3px 0 @dark);
  235. border-color: saturate(@dark, 10%);
  236. }
  237. }
  238. &.mk_input, &.mk_textarea {
  239. .mk_control;
  240. resize: none;
  241. padding: 0 4px;
  242. text-shadow: 0 0 0;
  243. &:focus {
  244. .box-shadow(inset 0 0 3px 0 @dark);
  245. border-color: @blue;
  246. }
  247. }
  248. &.mk_checkbox {
  249. .no-select;
  250. background: url('../images/moka/check.png') 50% 50% no-repeat;
  251. height: 16px;
  252. width: 16px;
  253. &:focus {
  254. outline: 0;
  255. }
  256. &.checked {
  257. background-image: url('../images/moka/check-active.png');
  258. }
  259. }
  260. &.mk_switch {
  261. .no-select;
  262. .mk_button;
  263. .rounded(20px);
  264. vertical-align: middle;
  265. display: inline-block;
  266. height: 20px;
  267. width: 39px;
  268. background: url('../images/moka/switch.png') 100% 50% no-repeat;
  269. .transition(background, .2s);
  270. border-color: darken(@dark, 10%);
  271. &:active {
  272. background: url('../images/moka/switch.png') 100% 50% no-repeat;
  273. }
  274. &.checked {
  275. background: url('../images/moka/switch.png') 0% 50% no-repeat;
  276. }
  277. }
  278. // Lists
  279. &.mk_list {
  280. cursor: default;
  281. .mk_default;
  282. .no-select;
  283. .mk_control;
  284. padding: 0;
  285. background: white;
  286. &:focus {
  287. outline: 0;
  288. border-color: @blue;
  289. li.selected {
  290. background: lighten(@blue, 10%);
  291. color: white;
  292. }
  293. }
  294. li {
  295. line-height: 2em;
  296. padding: 0 4px;
  297. text-shadow: 0 0 0;
  298. &.selected {
  299. background: lighten(@grey, 20%);
  300. }
  301. }
  302. &.mk_sourcelist {
  303. background: transparent;
  304. border: 0;
  305. .rounded(0);
  306. .box-shadow(0 0 0);
  307. li {
  308. border-top: 1px solid transparent;
  309. border-bottom: 1px solid transparent;
  310. padding: 0 14px;
  311. }
  312. &:focus li.selected, li.selected {
  313. text-shadow: 0 1px 0 @verydark;
  314. .gradient(lighten(@blue, 10%), lighten(@blue, 10%), lighten(@blue, 20%));
  315. border-top: 1px solid @blue;
  316. border-bottom: 1px solid @blue;
  317. color: white;
  318. font-weight: bold;
  319. }
  320. }
  321. }
  322. // Dropdowns
  323. &.mk_dropdown {
  324. .mk_button;
  325. text-align: left;
  326. padding: 0 8px;
  327. .mk_dropdown_arrows {
  328. position: absolute;
  329. right: 0;
  330. height: 100%;
  331. width: 24px;
  332. top: 0;
  333. background-image: url(/images/moka/dropdown_arrows.png);
  334. background-position: center;
  335. background-repeat: no-repeat;
  336. border-left: 1px solid darken(@grey, 10%);
  337. }
  338. }
  339. &.mk_dropdown_pane {
  340. padding: 6px;
  341. margin-left: -6px;
  342. margin-top: -6px;
  343. .mk_dropdown_list {
  344. position: relative;
  345. display: inline-block;
  346. border: 0;
  347. background: white;
  348. .box-shadow(0 0 6px darken(@dark, 20%));
  349. .rounded(0);
  350. min-width: 120px;
  351. max-height: 400px;
  352. li {
  353. padding: 0 6px;
  354. &.selected {
  355. background: @blue;
  356. color: white;
  357. };
  358. }
  359. &:focus {
  360. border: 0;
  361. }
  362. }
  363. }
  364. }