Blog-style website for karathan using the self-made Stellar Theme powered by HTML5Up http://blog.karathan.at

_form.scss 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. ///
  2. /// Stellar 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. }
  10. label {
  11. display: block;
  12. font-size: 0.9em;
  13. font-weight: _font(weight-bold);
  14. margin: 0 0 (_size(element-margin) * 0.5) 0;
  15. }
  16. input[type="text"],
  17. input[type="password"],
  18. input[type="email"],
  19. select,
  20. textarea {
  21. @include vendor('appearance', 'none');
  22. border-radius: _size(border-radius);
  23. border: solid 1px;
  24. color: inherit;
  25. display: block;
  26. outline: 0;
  27. padding: 0 1em;
  28. text-decoration: none;
  29. width: 100%;
  30. &:invalid {
  31. box-shadow: none;
  32. }
  33. }
  34. select {
  35. background-size: 1.25rem;
  36. background-repeat: no-repeat;
  37. background-position: calc(100% - 1rem) center;
  38. height: _size(element-height);
  39. padding-right: _size(element-height);
  40. text-overflow: ellipsis;
  41. &:focus {
  42. &::-ms-value {
  43. background-color: transparent;
  44. }
  45. }
  46. &::-ms-expand {
  47. display: none;
  48. }
  49. }
  50. input[type="text"],
  51. input[type="password"],
  52. input[type="email"],
  53. select {
  54. height: _size(element-height);
  55. }
  56. textarea {
  57. padding: 0.75em 1em;
  58. }
  59. input[type="checkbox"],
  60. input[type="radio"], {
  61. @include vendor('appearance', 'none');
  62. display: block;
  63. float: left;
  64. margin-right: -2em;
  65. opacity: 0;
  66. width: 1em;
  67. z-index: -1;
  68. & + label {
  69. @include icon;
  70. cursor: pointer;
  71. display: inline-block;
  72. font-size: 1em;
  73. font-weight: _font(weight);
  74. padding-left: (_size(element-height) * 0.6) + 0.75em;
  75. padding-right: 0.75em;
  76. position: relative;
  77. &:before {
  78. border-radius: _size(border-radius);
  79. border: solid 1px;
  80. content: '';
  81. display: inline-block;
  82. height: (_size(element-height) * 0.6);
  83. left: 0;
  84. line-height: (_size(element-height) * 0.575);
  85. position: absolute;
  86. text-align: center;
  87. top: 0;
  88. width: (_size(element-height) * 0.6);
  89. }
  90. }
  91. &:checked + label {
  92. &:before {
  93. content: '\f00c';
  94. }
  95. }
  96. }
  97. input[type="checkbox"] {
  98. & + label {
  99. &:before {
  100. border-radius: _size(border-radius);
  101. }
  102. }
  103. }
  104. input[type="radio"] {
  105. & + label {
  106. &:before {
  107. border-radius: 100%;
  108. }
  109. }
  110. }
  111. ::-webkit-input-placeholder {
  112. opacity: 1.0;
  113. }
  114. :-moz-placeholder {
  115. opacity: 1.0;
  116. }
  117. ::-moz-placeholder {
  118. opacity: 1.0;
  119. }
  120. :-ms-input-placeholder {
  121. opacity: 1.0;
  122. }
  123. @mixin color-form($p: null) {
  124. label {
  125. color: _palette($p, fg-bold);
  126. }
  127. input[type="text"],
  128. input[type="password"],
  129. input[type="email"],
  130. select,
  131. textarea {
  132. background-color: _palette($p, border-bg);
  133. border-color: _palette($p, border);
  134. &:focus {
  135. border-color: _palette(accent);
  136. box-shadow: 0 0 0 1px _palette(accent);
  137. }
  138. }
  139. select {
  140. background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette($p, border)}' /></svg>");
  141. option {
  142. color: _palette($p, fg-bold);
  143. background: _palette($p, bg);
  144. }
  145. }
  146. input[type="checkbox"],
  147. input[type="radio"], {
  148. & + label {
  149. color: _palette($p, fg);
  150. &:before {
  151. background: _palette($p, border-bg);
  152. border-color: _palette($p, border);
  153. }
  154. }
  155. &:checked + label {
  156. &:before {
  157. background-color: _palette($p, fg-bold);
  158. border-color: _palette($p, fg-bold);
  159. color: _palette($p, bg);
  160. }
  161. }
  162. &:focus + label {
  163. &:before {
  164. border-color: _palette(accent);
  165. box-shadow: 0 0 0 1px _palette(accent);
  166. }
  167. }
  168. }
  169. ::-webkit-input-placeholder {
  170. color: _palette($p, fg-light) !important;
  171. }
  172. :-moz-placeholder {
  173. color: _palette($p, fg-light) !important;
  174. }
  175. ::-moz-placeholder {
  176. color: _palette($p, fg-light) !important;
  177. }
  178. :-ms-input-placeholder {
  179. color: _palette($p, fg-light) !important;
  180. }
  181. .formerize-placeholder {
  182. color: _palette($p, fg-light) !important;
  183. }
  184. }
  185. @include color-form;