form.css

Same filename in this branch
  1. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/form.css
  2. 8.9.x core/themes/seven/css/classy/components/form.css
  3. 8.9.x core/themes/claro/css/components/form.css
  4. 8.9.x core/themes/bartik/css/components/form.css
  5. 8.9.x core/themes/bartik/css/classy/components/form.css
  6. 8.9.x core/themes/classy/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. 10 core/profiles/demo_umami/themes/umami/css/components/forms/form.css
  11. 10 core/misc/dialog/off-canvas/css/form.css
  12. 10 core/themes/olivero/css/components/form.css
  13. 10 core/themes/claro/css/components/form.css
  14. 10 core/themes/starterkit_theme/css/components/form.css
  15. 11.x core/profiles/demo_umami/themes/umami/css/components/forms/form.css
  16. 11.x core/misc/dialog/off-canvas/css/form.css
  17. 11.x core/themes/olivero/css/components/form.css
  18. 11.x core/themes/claro/css/components/form.css
  19. 11.x core/themes/starterkit_theme/css/components/form.css
/**
 * Form elements.
 */
form {
  margin: 0;
  padding: 0;
}
fieldset:not(.fieldgroup) {
  position: relative;
  min-width: 0;
  margin: 1em 0;
  padding: 30px 18px 18px;
  border-radius: 2px;
  background-color: #fcfcfa;
}
fieldset:not(.fieldgroup) > legend {
  position: absolute;
  top: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1em;
  font-weight: bold;
}
.fieldgroup {
  min-width: 0;
}
.form-item {
  margin: 0.75em 0;
}
/**
 * When a table row has a single form item, prevent it from adding unnecessary
 * extra spacing. If it has multiple form items, allow spacing between them,
 * overriding Classy.
 */
tr.odd .form-item,
tr.even .form-item {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}
td > .form-item:only-child {
  margin-top: 0;
  margin-bottom: 0;
}
.form-type-checkbox {
  padding: 0;
}
label {
  display: table;
  margin: 0 0 0.1em;
  padding: 0;
  font-weight: bold;
}
label.error {
  color: #a51b00;
}
label[for] {
  cursor: pointer;
}
.form-item label.option {
  text-transform: none;
}
.form-item label.option input {
  vertical-align: middle;
}
.form-disabled label {
  color: #686868;
}
.form-disabled input.form-date,
.form-disabled input.form-text,
.form-disabled input.form-tel,
.form-disabled input.form-time,
.form-disabled input.form-email,
.form-disabled input.form-url,
.form-disabled input.form-search,
.form-disabled input.form-number,
.form-disabled input.form-color,
.form-disabled input.form-file,
.form-disabled textarea.form-textarea,
.form-disabled select.form-select {
  border-color: #d4d4d4;
  background-color: hsla(0, 0%, 0%, 0.08);
  box-shadow: none;
}
.form-item input.error,
.form-item textarea.error,
.form-item select.error {
  color: #a51b00;
  border-width: 1px;
  border-color: #e62600;
  background-color: hsla(15, 75%, 97%, 1);
  box-shadow: inset 0 5px 5px -5px #b8b8b8;
}
.form-item textarea.error + .cke {
  border-width: 1px;
  border-color: #e62600;
}
.form-item input.error:focus,
.form-item textarea.error:focus,
.form-item select.error:focus {
  border-color: #e62600;
  outline: 0;
  background-color: #fcf4f2;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 8px 1px #e62600;
}
.form-required:after {
  width: 7px;
  height: 7px;
  background-size: 7px 7px;
}
.form-item--error-message {
  margin-top: 0.15em;
  color: #e32700;
}
.fieldset-wrapper > .form-item--error-message {
  margin-top: 0;
}
.text-format-wrapper .form-item--error-message {
  margin: 0;
  padding: 0.25em 0.666em 0;
  border: solid #ccc;
  border-width: 0 1px;
}

/* Filter */
ul.tips,
div.description,
.form-item .description {
  margin: 0.2em 0 0 0;
  color: #595959;
  font-size: 0.95em;
}
.form-item .description.error {
  margin-top: 0;
  color: #a51b00;
}

ul.tips li {
  margin: 0.25em 0 0.25em 1.5em; /* LTR */
}
[dir="rtl"] ul.tips li {
  margin: 0.25em 1.5em 0.25em 0;
}
.form-type-radio .description,
.form-type-checkbox .description {
  margin-left: 1.5em; /* LTR */
}
[dir="rtl"] .form-type-radio .description,
[dir="rtl"] .form-type-checkbox .description {
  margin-right: 1.5em;
  margin-left: 0;
}
.form-text,
.form-textarea {
  border-radius: 2px;
  font-size: 1em;
  line-height: normal;
}

input.form-autocomplete,
input.form-text,
input.form-tel,
input.form-email,
input.form-url,
input.form-search,
input.form-number,
input.form-color,
input.form-file,
input.form-date,
input.form-time,
textarea.form-textarea {
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.3em 0.4em 0.3em 0.5em; /* LTR */
  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
  transition: border linear 0.2s, box-shadow linear 0.2s;
  color: #595959;
  border: 1px solid #b8b8b8;
  border-top-color: #999;
  border-radius: 2px;
  background: #fcfcfa;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.125);
  font-size: 1em;
}
[dir="rtl"] textarea.form-textarea {
  padding: 0.3em 0.5em 0.3em 0.4em;
}
.form-text:focus,
.form-tel:focus,
.form-email:focus,
.form-url:focus,
.form-search:focus,
.form-number:focus,
.form-color:focus,
.form-file:focus,
.form-textarea:focus,
.form-date:focus,
.form-time:focus {
  border-color: #40b6ff;
  outline: 0;
  background-color: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 8px #40b6ff;
}

.confirm-parent,
.password-parent {
  overflow: visible;
  width: auto;
}

.form-item-options-group-info-identifier,
.form-item-pass .description {
  clear: both;
}

/**
 * Limits extra long instances of select elements to the max width allowed
 * to avoid breaking layouts.
 */
select {
  max-width: 100%;
}

/**
 * Select elements - Webkit only
 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select {
    padding: 1px 1.571em 1px 0.5em; /* LTR */
    cursor: pointer;
    -webkit-transition: all 0.1s;
    transition: all 0.1s;
    border: 1px solid #a6a6a6;
    border-radius: 0.143em;
    background:
      url(../../../../misc/icons/333333/caret-down.svg) no-repeat 99% 63%,
      -webkit-linear-gradient(top, #f6f6f3, #e7e7df); /* LTR */

    text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
    font-size: 0.875rem;
    -webkit-appearance: none;
    -webkit-font-smoothing: antialiased;
  }
  [dir="rtl"] select {
    padding: 1px 0.714em 1px 1.571em;
    background-position: 1% 63%, 0 0;
  }
  select:focus,
  select:hover {
    color: #1a1a1a;
    background-image:
      url(../../../../misc/icons/333333/caret-down.svg),
      -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  }
  select:hover {
    box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  }
}

/**
 * Improve spacing of cancel link.
 */
#edit-cancel {
  margin-left: 10px; /* LTR */
}
[dir="rtl"] #edit-cancel {
  margin-right: 10px;
  margin-left: 0;
}

/**
 * Improve form element usability on narrow devices.
 */
@media screen and (max-width: 600px) {
  input.form-autocomplete,
  input.form-text,
  input.form-tel,
  input.form-email,
  input.form-url,
  input.form-search,
  input.form-number,
  input.form-color,
  input.form-file,
  textarea.form-textarea {
    width: 100%;
    font-size: 1.2em;
    line-height: 1.2em;
  }
  input.form-number {
    width: auto;
  }
  .form-actions input,
  .form-wrapper input[type="submit"] {
    float: none;
    width: 100%;
    margin-top: 10px;
    margin-right: 0;
    margin-left: 0;
    padding-bottom: 6px;
  }
  .form-actions input:first-child,
  .form-wrapper input[type="submit"]:first-child {
    margin-top: 0;
  }
  details summary {
    overflow: hidden;
    box-sizing: border-box;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .password-strength {
    width: 100%;
  }
  div.form-item div.password-suggestions {
    float: none;
  }
  #dblog-filter-form .form-actions {
    float: none;
    padding: 0;
  }
  #edit-cancel {
    display: block;
    margin: 10px 0 0 0;
  }
  select {
    width: 100%;
  }
}

/* Exceptions */
#diff-inline-form select,
div.filter-options select {
  padding: 0;
}

File

core/themes/seven/css/components/form.css

View source
  1. /**
  2. * Form elements.
  3. */
  4. form {
  5. margin: 0;
  6. padding: 0;
  7. }
  8. fieldset:not(.fieldgroup) {
  9. position: relative;
  10. min-width: 0;
  11. margin: 1em 0;
  12. padding: 30px 18px 18px;
  13. border-radius: 2px;
  14. background-color: #fcfcfa;
  15. }
  16. fieldset:not(.fieldgroup) > legend {
  17. position: absolute;
  18. top: 10px;
  19. letter-spacing: 0.08em;
  20. text-transform: uppercase;
  21. font-size: 1em;
  22. font-weight: bold;
  23. }
  24. .fieldgroup {
  25. min-width: 0;
  26. }
  27. .form-item {
  28. margin: 0.75em 0;
  29. }
  30. /**
  31. * When a table row has a single form item, prevent it from adding unnecessary
  32. * extra spacing. If it has multiple form items, allow spacing between them,
  33. * overriding Classy.
  34. */
  35. tr.odd .form-item,
  36. tr.even .form-item {
  37. margin-top: 0.75em;
  38. margin-bottom: 0.75em;
  39. }
  40. td > .form-item:only-child {
  41. margin-top: 0;
  42. margin-bottom: 0;
  43. }
  44. .form-type-checkbox {
  45. padding: 0;
  46. }
  47. label {
  48. display: table;
  49. margin: 0 0 0.1em;
  50. padding: 0;
  51. font-weight: bold;
  52. }
  53. label.error {
  54. color: #a51b00;
  55. }
  56. label[for] {
  57. cursor: pointer;
  58. }
  59. .form-item label.option {
  60. text-transform: none;
  61. }
  62. .form-item label.option input {
  63. vertical-align: middle;
  64. }
  65. .form-disabled label {
  66. color: #686868;
  67. }
  68. .form-disabled input.form-date,
  69. .form-disabled input.form-text,
  70. .form-disabled input.form-tel,
  71. .form-disabled input.form-time,
  72. .form-disabled input.form-email,
  73. .form-disabled input.form-url,
  74. .form-disabled input.form-search,
  75. .form-disabled input.form-number,
  76. .form-disabled input.form-color,
  77. .form-disabled input.form-file,
  78. .form-disabled textarea.form-textarea,
  79. .form-disabled select.form-select {
  80. border-color: #d4d4d4;
  81. background-color: hsla(0, 0%, 0%, 0.08);
  82. box-shadow: none;
  83. }
  84. .form-item input.error,
  85. .form-item textarea.error,
  86. .form-item select.error {
  87. color: #a51b00;
  88. border-width: 1px;
  89. border-color: #e62600;
  90. background-color: hsla(15, 75%, 97%, 1);
  91. box-shadow: inset 0 5px 5px -5px #b8b8b8;
  92. }
  93. .form-item textarea.error + .cke {
  94. border-width: 1px;
  95. border-color: #e62600;
  96. }
  97. .form-item input.error:focus,
  98. .form-item textarea.error:focus,
  99. .form-item select.error:focus {
  100. border-color: #e62600;
  101. outline: 0;
  102. background-color: #fcf4f2;
  103. box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 8px 1px #e62600;
  104. }
  105. .form-required:after {
  106. width: 7px;
  107. height: 7px;
  108. background-size: 7px 7px;
  109. }
  110. .form-item--error-message {
  111. margin-top: 0.15em;
  112. color: #e32700;
  113. }
  114. .fieldset-wrapper > .form-item--error-message {
  115. margin-top: 0;
  116. }
  117. .text-format-wrapper .form-item--error-message {
  118. margin: 0;
  119. padding: 0.25em 0.666em 0;
  120. border: solid #ccc;
  121. border-width: 0 1px;
  122. }
  123. /* Filter */
  124. ul.tips,
  125. div.description,
  126. .form-item .description {
  127. margin: 0.2em 0 0 0;
  128. color: #595959;
  129. font-size: 0.95em;
  130. }
  131. .form-item .description.error {
  132. margin-top: 0;
  133. color: #a51b00;
  134. }
  135. ul.tips li {
  136. margin: 0.25em 0 0.25em 1.5em; /* LTR */
  137. }
  138. [dir="rtl"] ul.tips li {
  139. margin: 0.25em 1.5em 0.25em 0;
  140. }
  141. .form-type-radio .description,
  142. .form-type-checkbox .description {
  143. margin-left: 1.5em; /* LTR */
  144. }
  145. [dir="rtl"] .form-type-radio .description,
  146. [dir="rtl"] .form-type-checkbox .description {
  147. margin-right: 1.5em;
  148. margin-left: 0;
  149. }
  150. .form-text,
  151. .form-textarea {
  152. border-radius: 2px;
  153. font-size: 1em;
  154. line-height: normal;
  155. }
  156. input.form-autocomplete,
  157. input.form-text,
  158. input.form-tel,
  159. input.form-email,
  160. input.form-url,
  161. input.form-search,
  162. input.form-number,
  163. input.form-color,
  164. input.form-file,
  165. input.form-date,
  166. input.form-time,
  167. textarea.form-textarea {
  168. box-sizing: border-box;
  169. max-width: 100%;
  170. padding: 0.3em 0.4em 0.3em 0.5em; /* LTR */
  171. -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
  172. transition: border linear 0.2s, box-shadow linear 0.2s;
  173. color: #595959;
  174. border: 1px solid #b8b8b8;
  175. border-top-color: #999;
  176. border-radius: 2px;
  177. background: #fcfcfa;
  178. box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.125);
  179. font-size: 1em;
  180. }
  181. [dir="rtl"] textarea.form-textarea {
  182. padding: 0.3em 0.5em 0.3em 0.4em;
  183. }
  184. .form-text:focus,
  185. .form-tel:focus,
  186. .form-email:focus,
  187. .form-url:focus,
  188. .form-search:focus,
  189. .form-number:focus,
  190. .form-color:focus,
  191. .form-file:focus,
  192. .form-textarea:focus,
  193. .form-date:focus,
  194. .form-time:focus {
  195. border-color: #40b6ff;
  196. outline: 0;
  197. background-color: #fff;
  198. box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 8px #40b6ff;
  199. }
  200. .confirm-parent,
  201. .password-parent {
  202. overflow: visible;
  203. width: auto;
  204. }
  205. .form-item-options-group-info-identifier,
  206. .form-item-pass .description {
  207. clear: both;
  208. }
  209. /**
  210. * Limits extra long instances of select elements to the max width allowed
  211. * to avoid breaking layouts.
  212. */
  213. select {
  214. max-width: 100%;
  215. }
  216. /**
  217. * Select elements - Webkit only
  218. */
  219. @media screen and (-webkit-min-device-pixel-ratio: 0) {
  220. select {
  221. padding: 1px 1.571em 1px 0.5em; /* LTR */
  222. cursor: pointer;
  223. -webkit-transition: all 0.1s;
  224. transition: all 0.1s;
  225. border: 1px solid #a6a6a6;
  226. border-radius: 0.143em;
  227. background:
  228. url(../../../../misc/icons/333333/caret-down.svg) no-repeat 99% 63%,
  229. -webkit-linear-gradient(top, #f6f6f3, #e7e7df); /* LTR */
  230. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  231. font-size: 0.875rem;
  232. -webkit-appearance: none;
  233. -webkit-font-smoothing: antialiased;
  234. }
  235. [dir="rtl"] select {
  236. padding: 1px 0.714em 1px 1.571em;
  237. background-position: 1% 63%, 0 0;
  238. }
  239. select:focus,
  240. select:hover {
  241. color: #1a1a1a;
  242. background-image:
  243. url(../../../../misc/icons/333333/caret-down.svg),
  244. -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  245. }
  246. select:hover {
  247. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  248. }
  249. }
  250. /**
  251. * Improve spacing of cancel link.
  252. */
  253. #edit-cancel {
  254. margin-left: 10px; /* LTR */
  255. }
  256. [dir="rtl"] #edit-cancel {
  257. margin-right: 10px;
  258. margin-left: 0;
  259. }
  260. /**
  261. * Improve form element usability on narrow devices.
  262. */
  263. @media screen and (max-width: 600px) {
  264. input.form-autocomplete,
  265. input.form-text,
  266. input.form-tel,
  267. input.form-email,
  268. input.form-url,
  269. input.form-search,
  270. input.form-number,
  271. input.form-color,
  272. input.form-file,
  273. textarea.form-textarea {
  274. width: 100%;
  275. font-size: 1.2em;
  276. line-height: 1.2em;
  277. }
  278. input.form-number {
  279. width: auto;
  280. }
  281. .form-actions input,
  282. .form-wrapper input[type="submit"] {
  283. float: none;
  284. width: 100%;
  285. margin-top: 10px;
  286. margin-right: 0;
  287. margin-left: 0;
  288. padding-bottom: 6px;
  289. }
  290. .form-actions input:first-child,
  291. .form-wrapper input[type="submit"]:first-child {
  292. margin-top: 0;
  293. }
  294. details summary {
  295. overflow: hidden;
  296. box-sizing: border-box;
  297. white-space: nowrap;
  298. text-overflow: ellipsis;
  299. }
  300. .password-strength {
  301. width: 100%;
  302. }
  303. div.form-item div.password-suggestions {
  304. float: none;
  305. }
  306. #dblog-filter-form .form-actions {
  307. float: none;
  308. padding: 0;
  309. }
  310. #edit-cancel {
  311. display: block;
  312. margin: 10px 0 0 0;
  313. }
  314. select {
  315. width: 100%;
  316. }
  317. }
  318. /* Exceptions */
  319. #diff-inline-form select,
  320. div.filter-options select {
  321. padding: 0;
  322. }

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