You are here

form.css in Drupal 9

Main form and form item styles.

File

core/themes/claro/css/components/form.css
View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Main form and form item styles.
  10. */
  11. :-ms-input-placeholder {
  12. color: #8e929c;
  13. }
  14. ::placeholder {
  15. color: #8e929c;
  16. }
  17. /* IE 10 and 11 needs this set as important. */
  18. :-ms-input-placeholder {
  19. color: #8e929c !important;
  20. }
  21. /**
  22. * General form item.
  23. */
  24. .form-item {
  25. margin-top: 1.5rem;
  26. margin-bottom: 1.5rem;
  27. }
  28. /**
  29. * When a table row or a container-inline has a single form item, prevent it
  30. * from adding unnecessary extra spacing.
  31. * If it has multiple form items, allow spacing between them, overriding Classy.
  32. */
  33. tr .form-item,
  34. .container-inline .form-item {
  35. margin-top: 0.75rem;
  36. margin-bottom: 0.75rem;
  37. }
  38. /**
  39. * Form element label.
  40. */
  41. .form-item__label {
  42. display: table;
  43. margin-top: 0.25rem; /* 4px */
  44. margin-bottom: 0.25rem; /* 4px */
  45. font-size: 0.889rem; /* ~14px */
  46. font-weight: bold;
  47. line-height: 1.125rem;
  48. }
  49. .form-item__label--multiple-value-form {
  50. margin-top: 0;
  51. margin-bottom: 0;
  52. font-size: inherit;
  53. font-weight: inherit;
  54. line-height: inherit;
  55. }
  56. .form-item__label[for] {
  57. cursor: pointer;
  58. }
  59. .form-item__label.option {
  60. display: inline;
  61. font-weight: normal;
  62. }
  63. /* Label states. */
  64. .form-item__label.has-error {
  65. color: #d72222;
  66. }
  67. .form-item__label.option.has-error {
  68. color: inherit;
  69. }
  70. .form-item__label.is-disabled {
  71. cursor: default; /* @todo ...or auto? */
  72. color: #82828c;
  73. }
  74. .form-item__label.form-required::after,
  75. .fieldset__label.form-required::after {
  76. display: inline-block;
  77. margin-right: 0.15em;
  78. margin-left: 0.15em;
  79. content: "*";
  80. color: #d72222;
  81. font-size: 0.875rem;
  82. }
  83. /**
  84. * Form item description.
  85. */
  86. .form-item__description {
  87. margin-top: 0.375rem; /* 6px */
  88. margin-bottom: 0.375rem; /* 6px */
  89. color: #545560;
  90. font-size: 0.79rem; /* ~13px */
  91. line-height: 1.0625rem; /* 17px */
  92. }
  93. /* Description states. */
  94. .form-item__description.is-disabled {
  95. color: #82828c;
  96. }
  97. /**
  98. * Error message (Inline form errors).
  99. */
  100. .form-item__error-message {
  101. margin-top: 0.375rem; /* 6px */
  102. margin-bottom: 0.375rem; /* 6px */
  103. color: #d72222;
  104. font-size: 0.79rem; /* ~13px */
  105. font-weight: normal;
  106. line-height: 1.0625rem; /* 17px */
  107. }
  108. .form-item__prefix.is-disabled,
  109. .form-item__suffix.is-disabled {
  110. color: #82828c;
  111. }
  112. /* Add some spacing so that the focus ring and suffix don't overlap. */
  113. @media screen and (min-width: 37.5625rem) {
  114. .form-item__suffix {
  115. margin-left: 0.5rem; /* LTR */
  116. }
  117. [dir="rtl"] .form-item__suffix {
  118. margin-right: 0.5rem;
  119. margin-left: 0;
  120. }
  121. }
  122. /**
  123. * Form actions.
  124. */
  125. .form-actions {
  126. display: flex;
  127. flex-wrap: wrap;
  128. align-items: flex-start;
  129. margin-top: 1rem;
  130. margin-bottom: 1rem;
  131. }
  132. .form-actions .button,
  133. .form-actions .action-link {
  134. margin-top: 1rem;
  135. margin-bottom: 1rem;
  136. }
  137. .form-actions .ajax-progress--throbber {
  138. -ms-grid-row-align: center;
  139. align-self: center;
  140. }
  141. /**
  142. * Password module.
  143. *
  144. * @legacy
  145. * @todo These should be in a standalone component file.
  146. */
  147. .confirm-parent,
  148. .password-parent {
  149. overflow: visible;
  150. width: auto;
  151. }
  152. .form-item-options-group-info-identifier,
  153. .form-item-pass .description {
  154. clear: both;
  155. }
  156. /**
  157. * Custom label placement for editor filter format select.
  158. */
  159. .form-item--editor-format {
  160. display: flex;
  161. flex-wrap: wrap;
  162. align-items: center;
  163. max-width: 100%;
  164. }
  165. .form-item--editor-format .form-item__label,
  166. .form-item--editor-format .form-item__prefix,
  167. .form-item--editor-format .form-item__suffix,
  168. .form-item--editor-format .form-element--editor-format {
  169. min-width: 1px;
  170. }
  171. .form-item--editor-format .form-item__label,
  172. .form-item--editor-format .form-item__prefix,
  173. .form-item--editor-format .form-item__suffix {
  174. margin-right: 0.5rem; /* LTR */
  175. }
  176. [dir="rtl"] .form-item--editor-format .form-item__label,
  177. [dir="rtl"] .form-item--editor-format .form-item__prefix,
  178. [dir="rtl"] .form-item--editor-format .form-item__suffix {
  179. margin-right: 0;
  180. margin-left: 0.5rem;
  181. }
  182. .form-item--editor-format .form-item__description,
  183. .form-item--editor-format .form-item__error-message {
  184. flex: 0 1 100%;
  185. min-width: 1px;
  186. }
  187. /**
  188. * Improve form element usability on narrow devices.
  189. *
  190. * @legacy
  191. */
  192. @media screen and (max-width: 37.5rem) {
  193. .password-strength {
  194. width: 100%;
  195. }
  196. div.form-item div.password-suggestions {
  197. float: none;
  198. }
  199. }
  200. /**
  201. * Prevent regression due to explicit line-heights applied to these elements in
  202. * normalize.css 7.0.0.
  203. */
  204. button {
  205. line-height: 1.125rem;
  206. }
  207. input,
  208. optgroup {
  209. line-height: 1.5rem;
  210. }
  211. /**
  212. * Prevent regression due to -webkit-appearance being set to button in
  213. * normalize.css 4.1.0.
  214. */
  215. ::-webkit-file-upload-button {
  216. -webkit-appearance: push-button;
  217. }