Lungo.widgets.form.less 4.3 KB

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