You are here

form.css in Drupal 9

/**
 * Form elements.
 */
form {
  margin: 0;
  padding: 0;
}

/**
 * Prevent regression due to explicit line-height and font-size applied to these
 * elements in normalize.css 7.0.0.
 */
button:not(.button),
input:not([type="file"],.form-text, .form-textarea) {
  line-height: 1.25em;
}
textarea,
input[type="search"],
input[type="number"],
input[type="email"] {
  line-height: normal;
}
select {
  font-size: 0.8125rem;
  line-height: 1.42902em;
}
details select {
  line-height: 1.20324em;
}

/**
 * Prevent regression due to fieldset styling that was removed in normalize.css
 * 6.0.0.
 */
fieldset {
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
  border: 1px solid #c0c0c0;
}
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;
}

/**
 * Prevent regression due to -webkit-appearance being set to button in
 * normalize.css 4.1.0.
 */
::-webkit-file-upload-button {
  -webkit-appearance: push-button;
}

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