form.css

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/css/components/forms/form.css
  2. 11.x core/misc/dialog/off-canvas/css/form.css
  3. 11.x core/themes/olivero/css/components/form.css
  4. 11.x core/themes/starterkit_theme/css/components/form.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/components/form.css
  2. 9 core/themes/olivero/css/components/form.css
  3. 9 core/themes/seven/css/components/form.css
  4. 9 core/themes/seven/css/classy/components/form.css
  5. 9 core/themes/claro/css/components/form.css
  6. 9 core/themes/bartik/css/components/form.css
  7. 9 core/themes/bartik/css/classy/components/form.css
  8. 9 core/themes/starterkit_theme/css/components/form.css
  9. 9 core/themes/classy/css/components/form.css
  10. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/form.css
  11. 8.9.x core/themes/seven/css/components/form.css
  12. 8.9.x core/themes/seven/css/classy/components/form.css
  13. 8.9.x core/themes/claro/css/components/form.css
  14. 8.9.x core/themes/bartik/css/components/form.css
  15. 8.9.x core/themes/bartik/css/classy/components/form.css
  16. 8.9.x core/themes/classy/css/components/form.css
  17. 10 core/profiles/demo_umami/themes/umami/css/components/forms/form.css
  18. 10 core/misc/dialog/off-canvas/css/form.css
  19. 10 core/themes/olivero/css/components/form.css
  20. 10 core/themes/claro/css/components/form.css
  21. 10 core/themes/starterkit_theme/css/components/form.css

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.