_form.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. ///
  2. /// Hyperspace by HTML5 UP
  3. /// html5up.net | @ajlkn
  4. /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
  5. ///
  6. /* Form */
  7. form {
  8. margin: 0 0 _size(element-margin) 0;
  9. .field {
  10. margin: 0 0 (_size(element-margin) * 0.5) 0;
  11. &.half {
  12. width: 50%;
  13. float: left;
  14. padding: 0 0 0 0.75em;
  15. &.first {
  16. padding: 0 0.75em 0 0;
  17. }
  18. }
  19. }
  20. > .actions {
  21. margin: _size(element-margin) 0 0 0 !important;
  22. }
  23. @include breakpoint(small) {
  24. .field {
  25. &.half {
  26. width: 100%;
  27. float: none;
  28. padding: 0;
  29. &.first {
  30. padding: 0;
  31. }
  32. }
  33. }
  34. }
  35. }
  36. label {
  37. color: _palette(fg-bold);
  38. font-weight: _font(weight-bold);
  39. line-height: 1.5;
  40. margin: 0 0 (_size(element-margin) * 0.35) 0;
  41. display: block;
  42. font-size: 1.1em;
  43. }
  44. input[type="text"],
  45. input[type="password"],
  46. input[type="email"],
  47. input[type="tel"],
  48. select,
  49. textarea {
  50. @include vendor('appearance', 'none');
  51. background: _palette(border-bg);
  52. border-radius: _size(border-radius);
  53. border: none;
  54. border: solid _size(border-width) _palette(border);
  55. color: inherit;
  56. display: block;
  57. outline: 0;
  58. padding: 0 1em;
  59. text-decoration: none;
  60. width: 100%;
  61. &:invalid {
  62. box-shadow: none;
  63. }
  64. &:focus {
  65. border-color: _palette(fg-bold);
  66. box-shadow: 0 0 0 _size(border-width) _palette(fg-bold);
  67. }
  68. }
  69. .select-wrapper {
  70. @include icon;
  71. display: block;
  72. position: relative;
  73. &:before {
  74. color: _palette(border);
  75. content: '\f078';
  76. display: block;
  77. height: _size(element-height);
  78. line-height: _size(element-height);
  79. pointer-events: none;
  80. position: absolute;
  81. right: 0;
  82. text-align: center;
  83. top: 0;
  84. width: _size(element-height);
  85. }
  86. select::-ms-expand {
  87. display: none;
  88. }
  89. }
  90. select {
  91. option {
  92. background-color: _palette(bg);
  93. color: _palette(fg-bold);
  94. }
  95. }
  96. input[type="text"],
  97. input[type="password"],
  98. input[type="email"],
  99. select {
  100. height: _size(element-height);
  101. }
  102. textarea {
  103. padding: 0.75em 1em;
  104. body.is-ie & {
  105. min-height: 10em;
  106. }
  107. }
  108. input[type="checkbox"],
  109. input[type="radio"], {
  110. @include vendor('appearance', 'none');
  111. display: block;
  112. float: left;
  113. margin-right: -2em;
  114. opacity: 0;
  115. width: 1em;
  116. z-index: -1;
  117. & + label {
  118. @include icon;
  119. color: _palette(fg);
  120. cursor: pointer;
  121. display: inline-block;
  122. font-size: 1em;
  123. font-weight: _font(weight);
  124. padding-left: (_size(element-height) * 0.6) + 0.75em;
  125. padding-right: 0.75em;
  126. position: relative;
  127. &:before {
  128. background: _palette(border-bg);
  129. border-radius: _size(border-radius);
  130. border: solid _size(border-width) _palette(border);
  131. content: '';
  132. display: inline-block;
  133. height: (_size(element-height) * 0.6);
  134. left: 0;
  135. line-height: (_size(element-height) * 0.575);
  136. position: absolute;
  137. text-align: center;
  138. top: 0;
  139. width: (_size(element-height) * 0.6);
  140. }
  141. }
  142. &:checked + label {
  143. &:before {
  144. background: _palette(fg-bold);
  145. border-color: _palette(fg-bold);
  146. color: _palette(accent3);
  147. content: '\f00c';
  148. }
  149. }
  150. &:focus + label {
  151. &:before {
  152. border-color: _palette(fg-bold);
  153. box-shadow: 0 0 0 _size(border-width) _palette(fg-bold);
  154. }
  155. }
  156. }
  157. input[type="checkbox"] {
  158. & + label {
  159. &:before {
  160. border-radius: _size(border-radius);
  161. }
  162. }
  163. }
  164. input[type="radio"] {
  165. & + label {
  166. &:before {
  167. border-radius: 100%;
  168. }
  169. }
  170. }
  171. ::-webkit-input-placeholder {
  172. color: _palette(fg-light) !important;
  173. opacity: 1.0;
  174. }
  175. :-moz-placeholder {
  176. color: _palette(fg-light) !important;
  177. opacity: 1.0;
  178. }
  179. ::-moz-placeholder {
  180. color: _palette(fg-light) !important;
  181. opacity: 1.0;
  182. }
  183. :-ms-input-placeholder {
  184. color: _palette(fg-light) !important;
  185. opacity: 1.0;
  186. }
  187. .formerize-placeholder {
  188. color: _palette(fg-light) !important;
  189. opacity: 1.0;
  190. }