1
0

moka.less 9.0 KB

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