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/claro/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/olivero/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. color: var(--color--gray-60);
  13. }
  14. /**
  15. * General form item.
  16. */
  17. .form-item {
  18. margin-block: var(--sp1);
  19. }
  20. .form-item__label--multiple-value-form {
  21. margin-block: 0;
  22. font-size: inherit;
  23. font-weight: inherit;
  24. line-height: inherit;
  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 core.
  30. */
  31. tr .form-item,
  32. .container-inline .form-item {
  33. margin-block: var(--sp0-5);
  34. }
  35. /**
  36. * Form element label.
  37. */
  38. .form-item__label {
  39. display: block;
  40. margin-block: var(--sp0-5);
  41. font-size: var(--font-size-s);
  42. font-weight: bold;
  43. line-height: var(--line-height-s);
  44. }
  45. .container-inline .form-item__label {
  46. margin-inline-end: 1em;
  47. }
  48. .form-item__label--multiple-value-form {
  49. margin-block: 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.is-disabled {
  63. cursor: default;
  64. color: var(--color--gray-70);
  65. }
  66. /* Form required star icon */
  67. .form-item__label.form-required::after,
  68. .fieldset__label.form-required::after,
  69. .required-mark::after {
  70. display: inline-block;
  71. width: 0.5rem;
  72. height: 0.5rem;
  73. margin-inline: 0.3em;
  74. content: "";
  75. vertical-align: text-top;
  76. /* Use a background image to prevent screen readers from announcing the text. */
  77. background-image: url("data:image/svg+xml,%3Csvg height='16' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m0 7.562 1.114-3.438c2.565.906 4.43 1.688 5.59 2.35-.306-2.921-.467-4.93-.484-6.027h3.511c-.05 1.597-.234 3.6-.558 6.003 1.664-.838 3.566-1.613 5.714-2.325l1.113 3.437c-2.05.678-4.06 1.131-6.028 1.356.984.856 2.372 2.381 4.166 4.575l-2.906 2.059c-.935-1.274-2.041-3.009-3.316-5.206-1.194 2.275-2.244 4.013-3.147 5.206l-2.856-2.059c1.872-2.307 3.211-3.832 4.017-4.575-2.081-.402-4.058-.856-5.93-1.356' fill='%232494DB'/%3E%3C/svg%3E%0A");
  78. background-repeat: no-repeat;
  79. background-size: 0.5rem 0.5rem;
  80. }
  81. @media screen and (-ms-high-contrast: active) {
  82. .form-item__label.form-required::after,
  83. .fieldset__label.form-required::after,
  84. .required-mark::after {
  85. background-image: url("data:image/svg+xml,%3Csvg height='16' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m0 7.562 1.114-3.438c2.565.906 4.43 1.688 5.59 2.35-.306-2.921-.467-4.93-.484-6.027h3.511c-.05 1.597-.234 3.6-.558 6.003 1.664-.838 3.566-1.613 5.714-2.325l1.113 3.437c-2.05.678-4.06 1.131-6.028 1.356.984.856 2.372 2.381 4.166 4.575l-2.906 2.059c-.935-1.274-2.041-3.009-3.316-5.206-1.194 2.275-2.244 4.013-3.147 5.206l-2.856-2.059c1.872-2.307 3.211-3.832 4.017-4.575-2.081-.402-4.058-.856-5.93-1.356' fill='%23ffffff'/%3E%3C/svg%3E%0A");
  86. }
  87. }
  88. /**
  89. * Form item description.
  90. */
  91. .form-item__description {
  92. margin-block: var(--sp0-5);
  93. max-width: 60ch;
  94. font-size: var(--font-size-s);
  95. line-height: var(--line-height-s);
  96. }
  97. .field-multiple-table + .form-item__description {
  98. margin-block-start: 0;
  99. }
  100. /**
  101. * Error message (Inline form errors).
  102. */
  103. .form-item--error-message {
  104. margin-block: var(--sp0-5);
  105. padding-inline-start: var(--sp1-5);
  106. color: var(--color--red);
  107. background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23E33F1E' d='M9 0C4.03125 0 0 4.03125 0 9C0 13.9688 4.03125 18 9 18C13.9687 18 18 13.9688 18 9C18 4.03125 13.9687 0 9 0ZM10.5 14.6133C10.5 14.8242 10.3359 15 10.1367 15H7.88672C7.67578 15 7.5 14.8242 7.5 14.6133V12.3867C7.5 12.1758 7.67578 12 7.88672 12H10.1367C10.3359 12 10.5 12.1758 10.5 12.3867V14.6133ZM10.4766 10.582C10.4648 10.7461 10.2891 10.875 10.0781 10.875H7.91016C7.6875 10.875 7.51172 10.7461 7.51172 10.582L7.3125 3.30469C7.3125 3.22266 7.34766 3.14063 7.42969 3.09375C7.5 3.03516 7.60547 3 7.71094 3H10.2891C10.3945 3 10.5 3.03516 10.5703 3.09375C10.6523 3.14063 10.6875 3.22266 10.6875 3.30469L10.4766 10.582Z'/%3E%3C/svg%3E");
  108. background-repeat: no-repeat;
  109. background-position: left top; /* LTR */
  110. background-size: var(--sp1) var(--sp1);
  111. font-size: var(--font-size-s);
  112. line-height: var(--line-height-s);
  113. }
  114. @media screen and (-ms-high-contrast: active) {
  115. .form-item--error-message {
  116. background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23ffffff' d='M9 0C4.03125 0 0 4.03125 0 9C0 13.9688 4.03125 18 9 18C13.9687 18 18 13.9688 18 9C18 4.03125 13.9687 0 9 0ZM10.5 14.6133C10.5 14.8242 10.3359 15 10.1367 15H7.88672C7.67578 15 7.5 14.8242 7.5 14.6133V12.3867C7.5 12.1758 7.67578 12 7.88672 12H10.1367C10.3359 12 10.5 12.1758 10.5 12.3867V14.6133ZM10.4766 10.582C10.4648 10.7461 10.2891 10.875 10.0781 10.875H7.91016C7.6875 10.875 7.51172 10.7461 7.51172 10.582L7.3125 3.30469C7.3125 3.22266 7.34766 3.14063 7.42969 3.09375C7.5 3.03516 7.60547 3 7.71094 3H10.2891C10.3945 3 10.5 3.03516 10.5703 3.09375C10.6523 3.14063 10.6875 3.22266 10.6875 3.30469L10.4766 10.582Z'/%3E%3C/svg%3E");
  117. }
  118. }
  119. [dir="rtl"] .form-item--error-message {
  120. background-position: right top;
  121. }
  122. /**
  123. * Form actions.
  124. */
  125. .form-actions {
  126. display: flex;
  127. flex-wrap: wrap;
  128. align-items: flex-start;
  129. margin-block: var(--sp0-5);
  130. }
  131. .form-actions .button,
  132. .form-actions .action-link {
  133. margin-block: var(--sp0-5);
  134. }
  135. .form-actions > .form-wrapper {
  136. margin-inline-end: var(--sp1);
  137. }
  138. .form-actions .ajax-progress--throbber {
  139. align-self: center;
  140. }
  141. /**
  142. * Custom label placement for editor filter format select.
  143. */
  144. .form-item--editor-format {
  145. display: flex;
  146. flex-wrap: wrap;
  147. align-items: center;
  148. max-width: 100%;
  149. }
  150. .form-item--editor-format .form-item__label,
  151. .form-item--editor-format .form-item__prefix,
  152. .form-item--editor-format .form-item__suffix,
  153. .form-item--editor-format .form-element--editor-format {
  154. min-width: 1px;
  155. }
  156. .form-item--editor-format .form-item__label,
  157. .form-item--editor-format .form-item__prefix,
  158. .form-item--editor-format .form-item__suffix {
  159. margin-inline-end: var(--sp0-5);
  160. }
  161. .form-item--editor-format .form-item__description,
  162. .form-item--editor-format .form-item--error-message {
  163. flex: 0 1 100%;
  164. min-width: 1px;
  165. }
  166. /**
  167. * Inline forms.
  168. */
  169. .form--inline > * {
  170. display: inline-block;
  171. margin-top: var(--sp0-5);
  172. margin-bottom: 0;
  173. vertical-align: top; /* Ensure proper alignment if description is present. */
  174. }
  175. .form--inline .form-item__label {
  176. margin: 0;
  177. }
  178. .form--inline .form-actions {
  179. margin-top: var(--sp1-5);
  180. }
  181. .layout-builder-form .form-actions {
  182. align-items: center;
  183. }

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