You are here

form.css in Drupal 10

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