moka.less 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
  20. }
  21. .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
  22. border-top: solid 1px @top-color;
  23. border-left: solid 1px @left-color;
  24. border-right: solid 1px @right-color;
  25. border-bottom: solid 1px @bottom-color;
  26. }
  27. .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
  28. -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  29. -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  30. box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  31. }
  32. .rounded(@radius: 3px) {
  33. -webkit-border-radius: @radius;
  34. -moz-border-radius: @radius;
  35. border-radius: @radius;
  36. }
  37. .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
  38. -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  39. -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  40. box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  41. }
  42. .box-shadow(@arguments) {
  43. -webkit-box-shadow: @arguments;
  44. -moz-box-shadow: @arguments;
  45. box-shadow: @arguments;
  46. }
  47. .transition(@property: all, @duration:0.2s, @ease:ease-out) {
  48. -webkit-transition: @property @duration @ease;
  49. -moz-transition: @property @duration @ease;
  50. -o-transition: @property @duration @ease;
  51. transition: @property @duration @ease;
  52. }
  53. .no-select {
  54. -webkit-touch-callout: none;
  55. -webkit-user-select: none;
  56. -khtml-user-select: none;
  57. -moz-user-select: none;
  58. -ms-user-select: none;
  59. user-select: none;
  60. }
  61. // Moka definitions
  62. // TEMP
  63. body {
  64. background: #f1f1f1;
  65. }
  66. .moka_view {
  67. display: inline-block;
  68. .mk_default {
  69. // Generic fonts
  70. font-size: 12px;
  71. font-family: "Open Sans";
  72. color: #555;
  73. text-shadow: 0 1px 0 white;
  74. }
  75. // Labels
  76. span {
  77. .mk_default;
  78. color: #333;
  79. padding: 4px;
  80. }
  81. // Controls
  82. .mk_control, .mk_control:active, .mk_control:focus {
  83. .mk_default;
  84. margin: 4px;
  85. padding: 3px 10px;
  86. .rounded();
  87. .bordered(#999, #999, #999, #999);
  88. .box-shadow(0 0 3px 0 #ccc);
  89. background: white;
  90. &:focus {
  91. outline: 0;
  92. }
  93. }
  94. button {
  95. .mk_control;
  96. .no-select;
  97. .gradient(#fafafa, #dedede, white);
  98. &:focus {
  99. border-color: #08c;
  100. }
  101. &:active {
  102. background: #ccc;
  103. .box-shadow(inset 0 0 3px 0 #888);
  104. border-color: #999;
  105. }
  106. }
  107. input, textarea {
  108. .mk_control;
  109. text-shadow: 0 0 0;
  110. &:focus {
  111. .box-shadow(inset 0 0 3px 0 #999);
  112. border-color: #08c;
  113. }
  114. }
  115. textarea {
  116. width: 200px;
  117. height: 100px;
  118. }
  119. input[type="checkbox"] {
  120. position: absolute;
  121. left: -999999px;
  122. }
  123. .mk_checkbox + label {
  124. .no-select;
  125. padding: 0 6px;
  126. margin: 4px;
  127. background: url('../images/moka/check.png') 50% 50% no-repeat;
  128. height: 16px;
  129. width: 16px;
  130. }
  131. .mk_checkbox:focus + label {
  132. background-image: url('../images/moka/check-focus.png');
  133. .box-shadow(0 0 2px #08c);
  134. }
  135. .mk_checkbox:checked + label {
  136. background-image: url('../images/moka/check-active.png');
  137. }
  138. .mk_switch + label {
  139. .no-select;
  140. .rounded(20px);
  141. margin: 4px;
  142. vertical-align: middle;
  143. display: inline-block;
  144. height: 20px;
  145. width: 59px;
  146. border: 1px solid #999;
  147. background: url('../images/moka/switch.png') 100% 50% no-repeat;
  148. .transition(background, .3s);
  149. }
  150. .mk_switch:focus + label {
  151. border-color: #08c;
  152. }
  153. .mk_switch:checked + label {
  154. background-position: 0% 50%;
  155. }
  156. }