Lungo.widgets.form.less 4.4 KB

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