Lungo.widgets.form.less 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /**
  2. * Stylesheet
  3. *
  4. * @namespace Lungo.Widgets
  5. * @class Form
  6. *
  7. * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
  8. */
  9. @import "constants.less";
  10. @import "mixins.less";
  11. @input-height: 29px;
  12. form {
  13. &.wrapper {
  14. & input:not([type=checkbox]), textarea, select {
  15. margin: 3px 0px 3px 0px;
  16. }
  17. }
  18. @rounded-radius: 8px;
  19. &.rounded {
  20. & input:not([type=checkbox]), textarea, select {
  21. width: 94%;
  22. padding: 1.0% 3% ;
  23. &:first-of-type { .border-radius(@rounded-radius @rounded-radius 0px 0px); }
  24. &:last-of-type { .border-radius(0px 0px @rounded-radius @rounded-radius); }
  25. }
  26. & .button {
  27. .border-radius(@rounded-radius);
  28. }
  29. }
  30. }
  31. label:not(.select) {
  32. font-size: 0.85em;
  33. line-height: 1.8em;
  34. }
  35. input:not([type=checkbox]), textarea, select {
  36. display: block;
  37. width: 96%;
  38. // margin: 0 0 6px;
  39. padding: 0.5% 2% ;
  40. height: @input-height;
  41. font-size: 14px;
  42. font-weight: bold;
  43. -webkit-appearance: none;
  44. -webkit-user-select: text;
  45. -webkit-font-smoothing: antialiased;
  46. }
  47. textarea {
  48. min-height: 48px;
  49. }
  50. /* @group search */
  51. input[type=search] {
  52. width: 86%;
  53. & + .button {
  54. float: right;
  55. padding: 0px;
  56. width: 32px;
  57. height: 30px;
  58. & .icon {
  59. font-size: 22px !important;
  60. line-height: 30px;
  61. }
  62. }
  63. }
  64. /* @end */
  65. /* @group select */
  66. select {
  67. width: 100%;
  68. height: @input-height;
  69. }
  70. label.select {
  71. position: relative;
  72. display: inline-block;
  73. width: 100%;
  74. }
  75. .select:after {
  76. text-align: center;
  77. position: absolute;
  78. top: 0;
  79. right: 0;
  80. bottom: 0;
  81. height: @input-height;
  82. width: @input-height;
  83. content: "▼";
  84. pointer-events:none;
  85. line-height: 31px;
  86. }
  87. .no-pointer-events .select:after {
  88. content: none;
  89. }
  90. /* @end */
  91. /* @group switch */
  92. input[type="checkbox"], input[type="radio"]{
  93. width: 82px;
  94. height: @input-height;
  95. z-index: 2;
  96. }
  97. input[type="checkbox"] + span::after,
  98. input[type="radio"] + span::after {
  99. content: "OFF";
  100. }
  101. input[type="checkbox"]:checked + span::after,
  102. input[type="radio"]:checked + span::after {
  103. content: "ON";
  104. }
  105. input[type="checkbox"] + span,
  106. input[type="radio"] + span,
  107. input[type="checkbox"] + span::before,
  108. input[type="radio"] + span::before,
  109. input[type="checkbox"] + span::after,
  110. input[type="radio"] + span::after {
  111. display: inline-block;
  112. }
  113. input[type="checkbox"] + span::before,
  114. input[type="radio"] + span::before,
  115. input[type="checkbox"] + span::after,
  116. input[type="radio"] + span::after,
  117. input[type="checkbox"]:checked + span::before,
  118. input[type="radio"]:checked + span::before,
  119. input[type="checkbox"]:checked + span::after,
  120. input[type="radio"]:checked + span::after {
  121. top: 0;
  122. }
  123. input[type="checkbox"] + span::after,
  124. input[type="radio"] + span::after,
  125. input[type="checkbox"]:checked + span::before,
  126. input[type="radio"]:checked + span::before {
  127. right: 0;
  128. }
  129. input[type="checkbox"] + span::before,
  130. input[type="radio"] + span::before,
  131. input[type="checkbox"]:checked + span::after,
  132. input[type="radio"]:checked + span::after {
  133. left: 0;
  134. }
  135. input[type="checkbox"],
  136. input[type="radio"],
  137. input[type="checkbox"] + span::before,
  138. input[type="radio"] + span::before,
  139. input[type="checkbox"] + span::after,
  140. input[type="radio"] + span::after {
  141. position: absolute;
  142. }
  143. input[type="checkbox"],
  144. input[type="radio"] {
  145. -webkit-opacity: 0;
  146. opacity: 0;
  147. }
  148. input[type="checkbox"] + span,
  149. input[type="radio"] + span {
  150. width: 82px;
  151. height: 27px;
  152. position: relative;
  153. font-size: 11px;
  154. line-height: @input-height;
  155. font-weight: bold;
  156. text-transform: uppercase;
  157. text-indent: -9999px;
  158. }
  159. input[type="checkbox"] + span::before,
  160. input[type="radio"] + span::before {
  161. content: "";
  162. width: 41px;
  163. height: 27px;
  164. }
  165. input[type="checkbox"] + span::after,
  166. input[type="radio"] + span::after {
  167. text-indent: 0;
  168. width: 41px;
  169. height: 27px;
  170. text-align: center;
  171. }
  172. input[type="checkbox"]:checked + span::before,
  173. input[type="radio"]:checked + span::before {
  174. left: auto;
  175. }
  176. input[type="checkbox"]:checked + span::after,
  177. input[type="radio"]:checked + span::after {
  178. height: 27px;
  179. }
  180. /* @end */
  181. /* @group range */
  182. input[type="range"] {
  183. -webkit-appearance: none;
  184. height: 15px;
  185. width: 100%;
  186. outline: none;
  187. position: relative;
  188. padding: 0px;
  189. margin: 0px;
  190. border: 0;
  191. cursor: ew-resize;
  192. &::-webkit-slider-thumb {
  193. -webkit-appearance: none;
  194. position: relative;
  195. z-index: 1;
  196. top:-1px;
  197. width: 24px;
  198. height: 24px;
  199. }
  200. }
  201. /* @end */
  202. /* @group progress */
  203. .progress {
  204. width: 100%;
  205. margin-bottom: 8px;
  206. .labels {
  207. font-size: 1.0em;
  208. display: block;
  209. & span:last-child { float: right; }
  210. }
  211. & .bar {
  212. height: 15px;
  213. line-height: 15px;
  214. display: block;
  215. & .value {
  216. display:block;
  217. height: inherit;
  218. width: 0%;
  219. -webkit-transition: width 500ms @defaultTrasition;
  220. & .label {
  221. float: right;
  222. margin-right: 4px;
  223. font-size: 0.75em;
  224. }
  225. }
  226. }
  227. }
  228. .big .progress .bar {
  229. height: @input-height;
  230. line-height: 30px;
  231. }
  232. /* @end */
  233. @media screen and (-webkit-min-device-pixel-ratio:0) {
  234. .custom-select select {padding-right:30px;}
  235. }