Lungo.widgets.form.less 5.4 KB

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