form.css

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

Main form and form item styles.

File

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

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