_forms.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. // These are the generic stylings for forms of any type.
  2. // If you're styling something specific to the page editing interface,
  3. // it probably ought to go in layouts/page-editor.scss
  4. form {
  5. ul,
  6. li {
  7. list-style-type: none;
  8. }
  9. ul {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. }
  14. fieldset {
  15. border: 0;
  16. padding: 0 0 2em;
  17. margin: 0;
  18. }
  19. legend {
  20. @include visuallyhidden();
  21. }
  22. label,
  23. .label {
  24. text-transform: none;
  25. font-weight: bold;
  26. color: $color-grey-1;
  27. font-size: 1.1em;
  28. display: block;
  29. padding: 0 0 0.8em;
  30. margin: 0;
  31. line-height: 1.3em;
  32. .checkbox &,
  33. .radio & {
  34. display: inline;
  35. }
  36. &.no-float {
  37. float: none;
  38. }
  39. @include media-breakpoint-up(sm) {
  40. @include column(2);
  41. padding-top: 1.2em;
  42. padding-left: 0;
  43. .radio_select &,
  44. .model_multiple_choice_field &,
  45. .boolean_field &,
  46. .model_choice_field &,
  47. .image_field & {
  48. padding-top: 0;
  49. }
  50. // Horrid specificity war
  51. .model_choice_field.select & {
  52. padding-top: 1.2em;
  53. }
  54. }
  55. }
  56. input,
  57. textarea,
  58. select,
  59. .halloeditor,
  60. .tagit {
  61. appearance: none;
  62. box-sizing: border-box;
  63. border-radius: 6px;
  64. width: 100%;
  65. font-family: Open Sans,Arial,sans-serif;
  66. border: 1px solid $color-input-border;
  67. padding: 0.9em 1.2em;
  68. background-color: $color-fieldset-hover;
  69. color: $color-text-input;
  70. font-size: 1.2em;
  71. font-weight: 300;
  72. &:hover {
  73. background-color: $color-white;
  74. }
  75. &:focus {
  76. background-color: $color-input-focus;
  77. border-color: $color-input-focus-border;
  78. }
  79. &:disabled,
  80. &[disabled],
  81. &:disabled:hover,
  82. &[disabled]:hover {
  83. background-color: $color-grey-4;
  84. cursor: not-allowed;
  85. color: $color-grey-2;
  86. }
  87. }
  88. // Reset the arrow on `<select>`s in IE10+.
  89. select::-ms-expand {
  90. display: none;
  91. }
  92. .file_field {
  93. .input {
  94. label {
  95. float: none;
  96. display: inline;
  97. padding: 0;
  98. }
  99. input[type=checkbox] {
  100. margin-top: 5px;
  101. }
  102. a {
  103. &:after {
  104. content: ' ';
  105. display: block;
  106. }
  107. }
  108. }
  109. }
  110. // radio and check boxes
  111. input[type=radio],
  112. input[type=checkbox] {
  113. border-radius: 0;
  114. cursor: pointer;
  115. border: 0;
  116. }
  117. input[type=radio] {
  118. height: 12px;
  119. width: auto;
  120. position: relative;
  121. margin-right: 27px;
  122. }
  123. input[type=radio]:before {
  124. border-radius: 100%;
  125. font-family: wagtail;
  126. font-style: normal;
  127. text-align: center;
  128. position: absolute;
  129. top: -5px;
  130. left: -2px;
  131. cursor: pointer;
  132. display: block;
  133. content: map-get($icons, 'radio-full');
  134. width: 1em;
  135. height: 1em;
  136. line-height: 1.1em;
  137. padding: 4px;
  138. background-color: $color-white;
  139. color: $color-grey-4;
  140. border: 1px solid $color-grey-4;
  141. }
  142. input[type=radio]:checked:before {
  143. content: map-get($icons, 'radio-full');
  144. color: $color-teal;
  145. }
  146. input[type=checkbox] {
  147. height: 12px;
  148. width: auto;
  149. position: relative;
  150. margin-right: 27px;
  151. }
  152. input[type=checkbox]:before {
  153. font-family: wagtail;
  154. font-style: normal;
  155. text-align: center;
  156. position: absolute;
  157. top: -5px;
  158. cursor: pointer;
  159. display: block;
  160. content: map-get($icons, 'tick');
  161. line-height: 20px;
  162. width: 20px;
  163. height: 20px;
  164. background-color: $color-white;
  165. border: 1px solid $color-grey-4;
  166. color: $color-white;
  167. }
  168. input[type=checkbox]:checked:before {
  169. color: $color-teal;
  170. }
  171. // Special styles to counteract Firefox's completely unwarranted assumptions about button styles
  172. input[type=submit],
  173. input[type=reset],
  174. input[type=button],
  175. button {
  176. padding: 0 1em;
  177. @include media-breakpoint-up(sm) {
  178. &.button-small {
  179. height: 2em;
  180. }
  181. }
  182. }
  183. // Transitions
  184. fieldset,
  185. input,
  186. textarea,
  187. select {
  188. @include transition(background-color 0.2s ease);
  189. }