_forms.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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: inherit;
  84. cursor: default;
  85. color: $color-grey-4;
  86. }
  87. }
  88. // Reset the arrow on `<select>`s in IE10+.
  89. select::-ms-expand {
  90. display: none;
  91. }
  92. // radio and check boxes
  93. input[type=radio],
  94. input[type=checkbox] {
  95. border-radius: 0;
  96. cursor: pointer;
  97. border: 0;
  98. }
  99. input[type=radio] {
  100. height: 12px;
  101. width: auto;
  102. position: relative;
  103. margin-right: 27px;
  104. }
  105. input[type=radio]:before {
  106. border-radius: 100%;
  107. font-family: wagtail;
  108. font-style: normal;
  109. text-align: center;
  110. position: absolute;
  111. top: -5px;
  112. left: -2px;
  113. cursor: pointer;
  114. display: block;
  115. content: map-get($icons, 'radio-full');
  116. width: 1em;
  117. height: 1em;
  118. line-height: 1.1em;
  119. padding: 4px;
  120. background-color: $color-white;
  121. color: $color-grey-4;
  122. border: 1px solid $color-grey-4;
  123. }
  124. input[type=radio]:checked:before {
  125. content: map-get($icons, 'radio-full');
  126. color: $color-teal;
  127. }
  128. input[type=checkbox] {
  129. height: 12px;
  130. width: auto;
  131. position: relative;
  132. margin-right: 27px;
  133. }
  134. input[type=checkbox]:before {
  135. font-family: wagtail;
  136. font-style: normal;
  137. text-align: center;
  138. position: absolute;
  139. top: -5px;
  140. cursor: pointer;
  141. display: block;
  142. content: map-get($icons, 'tick');
  143. line-height: 20px;
  144. width: 20px;
  145. height: 20px;
  146. background-color: $color-white;
  147. border: 1px solid $color-grey-4;
  148. color: $color-white;
  149. }
  150. input[type=checkbox]:checked:before {
  151. color: $color-teal;
  152. }
  153. // Special styles to counteract Firefox's completely unwarranted assumptions about button styles
  154. input[type=submit],
  155. input[type=reset],
  156. input[type=button],
  157. button {
  158. padding: 0 1em;
  159. @include media-breakpoint-up(sm) {
  160. &.button-small {
  161. height: 2em;
  162. }
  163. }
  164. }
  165. // Transitions
  166. fieldset,
  167. input,
  168. textarea,
  169. select {
  170. @include transition(background-color 0.2s ease);
  171. }