form.css

Same filename in this branch
  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/classy/components/form.css
  7. 9 core/themes/starterkit_theme/css/components/form.css
  8. 9 core/themes/classy/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. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/form.css
  12. 8.9.x core/themes/seven/css/components/form.css
  13. 8.9.x core/themes/seven/css/classy/components/form.css
  14. 8.9.x core/themes/claro/css/components/form.css
  15. 8.9.x core/themes/bartik/css/components/form.css
  16. 8.9.x core/themes/bartik/css/classy/components/form.css
  17. 8.9.x core/themes/classy/css/components/form.css

Visual styles for Bartik's forms.

File

core/themes/bartik/css/components/form.css

View source
  1. /**
  2. * @file
  3. * Visual styles for Bartik's forms.
  4. */
  5. /* Password field. */
  6. .password-field {
  7. margin: 0;
  8. }
  9. /* Form elements. */
  10. form {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. /**
  15. * Prevent regression due to explicit line-height applied to these elements in
  16. * normalize.css 7.0.0.
  17. */
  18. button {
  19. line-height: 1.21875rem;
  20. }
  21. input {
  22. line-height: normal;
  23. }
  24. select {
  25. line-height: 1.5;
  26. }
  27. /**
  28. * 1. Prevent regression due to fieldset styling that was removed in
  29. * normalize.css 6.0.0.
  30. */
  31. fieldset {
  32. min-width: 0;
  33. margin: 1em 0;
  34. padding: 0.35em 0.625em 0.75em; /* 1 */
  35. border: 1px solid #c0c0c0; /* 1 */
  36. }
  37. details,
  38. fieldset,
  39. .filter-wrapper {
  40. border-radius: 4px;
  41. }
  42. .filter-wrapper {
  43. border-top-left-radius: 0;
  44. border-top-right-radius: 0;
  45. }
  46. .filter-help a {
  47. font-size: 0.857em;
  48. }
  49. .filter-wrapper .form-item label {
  50. margin-right: 10px; /* LTR */
  51. }
  52. [dir="rtl"] .filter-wrapper .form-item label {
  53. margin-right: 0;
  54. margin-left: 10px;
  55. }
  56. summary {
  57. color: #3b3b3b;
  58. background: #dbdbdb;
  59. text-shadow: 0 1px 0 #fff;
  60. }
  61. details summary a {
  62. color: #3b3b3b;
  63. }
  64. details summary a:hover,
  65. details summary a:active,
  66. details summary a:focus {
  67. color: #000;
  68. }
  69. details .details-description {
  70. font-style: italic;
  71. }
  72. label {
  73. display: table;
  74. font-weight: bold;
  75. }
  76. label[for] {
  77. cursor: pointer;
  78. }
  79. input,
  80. textarea,
  81. select {
  82. font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
  83. }
  84. input {
  85. box-sizing: border-box;
  86. /* Keep form elements from overflowing their containers. */
  87. max-width: 100%;
  88. margin: 2px 0;
  89. padding: 4px;
  90. }
  91. input,
  92. textarea {
  93. font-size: 0.929em;
  94. }
  95. /**
  96. * Prevent regression due to -webkit-appearance being set to button and
  97. * font-family being set to inherit normalize.css 4.1.0.
  98. */
  99. ::-webkit-file-upload-button {
  100. -webkit-appearance: push-button;
  101. font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
  102. }
  103. /**
  104. * Make the font slightly bigger in mobile
  105. * @todo: check the correct font-size
  106. */
  107. @media screen and (max-width: 60em) { /* 920px */
  108. input,
  109. textarea {
  110. font-size: 16px;
  111. }
  112. }
  113. textarea {
  114. line-height: 1.5;
  115. }
  116. textarea.form-textarea {
  117. padding: 4px;
  118. }
  119. input.form-text,
  120. input.form-tel,
  121. input.form-email,
  122. input.form-url,
  123. input.form-search,
  124. input.form-file,
  125. input.form-number,
  126. input.form-color,
  127. textarea.form-textarea {
  128. color: #3b3b3b;
  129. border: 1px solid #ccc;
  130. }
  131. input.form-submit:hover,
  132. input.form-submit:focus {
  133. background: #dedede;
  134. }
  135. .password-suggestions ul li {
  136. margin-left: 1.2em; /* LTR */
  137. }
  138. [dir="rtl"] .password-suggestions ul li {
  139. margin-right: 1.2em;
  140. margin-left: 0;
  141. }
  142. .form-item label,
  143. .form-wrapper .label {
  144. font-size: 0.929em;
  145. }
  146. .form-wrapper .field-multiple-table .label {
  147. font-size: inherit;
  148. }
  149. .form-type-radio label,
  150. .form-type-checkbox label {
  151. margin-left: 4px; /* LTR */
  152. }
  153. [dir="rtl"] .form-type-radio label,
  154. [dir="rtl"] .form-type-checkbox label {
  155. margin-right: 4px;
  156. margin-left: 0;
  157. }
  158. .form-type-radio .description,
  159. .form-type-checkbox .description {
  160. margin-left: 2px; /* LTR */
  161. }
  162. [dir="rtl"] .form-type-radio .description,
  163. [dir="rtl"] .form-type-checkbox .description {
  164. margin-right: 2px;
  165. margin-left: 0;
  166. }
  167. .form-actions {
  168. padding-top: 10px;
  169. }
  170. /* Node Form */
  171. #edit-body {
  172. margin-bottom: 2em;
  173. }
  174. .node-form label,
  175. .node-form .description,
  176. .node-form .form-wrapper .label {
  177. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  178. }
  179. .node-form .form-wrapper .field-multiple-table .label {
  180. font-family: inherit;
  181. }
  182. .node-form .form-wrapper {
  183. margin-bottom: 2em;
  184. }
  185. .node-form .entity-content-form-footer,
  186. .node-form .field--name-status {
  187. margin-bottom: 0;
  188. }
  189. .node-form .form-actions {
  190. margin-top: 0;
  191. padding-top: 0;
  192. }
  193. /* Contact Form */
  194. .contact-form #edit-name {
  195. width: 75%;
  196. border-radius: 4px;
  197. }
  198. .contact-form #edit-mail {
  199. width: 75%;
  200. border-radius: 4px;
  201. }
  202. .contact-form #edit-subject {
  203. width: 75%;
  204. border-radius: 4px;
  205. }
  206. .contact-form #edit-message {
  207. width: 76.3%;
  208. border-top-left-radius: 4px;
  209. border-top-right-radius: 4px;
  210. }
  211. /* Disabled form elements */
  212. .form-disabled input,
  213. .form-disabled select,
  214. .form-disabled textarea {
  215. color: #717171;
  216. border-color: #bbb;
  217. background: #ededed;
  218. }
  219. .form-disabled label {
  220. color: #717171;
  221. }
  222. /* Comment form */
  223. .comment-form label {
  224. float: left; /* LTR */
  225. width: 120px;
  226. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  227. font-size: 0.929em;
  228. }
  229. [dir="rtl"] .comment-form label {
  230. float: right;
  231. }
  232. .comment-form input,
  233. .comment-form .form-select {
  234. margin: 0;
  235. border-radius: 4px;
  236. }
  237. .comment-form .form-type-textarea label {
  238. float: none;
  239. }
  240. .comment-form .form-item,
  241. .comment-form .form-radios,
  242. .comment-form .form-type-checkbox,
  243. .comment-form .form-select {
  244. overflow: hidden;
  245. margin-bottom: 10px;
  246. }
  247. .comment-form .form-type-checkbox,
  248. .comment-form .form-radios {
  249. margin-left: 120px; /* LTR */
  250. }
  251. [dir="rtl"] .comment-form .form-type-checkbox,
  252. [dir="rtl"] .comment-form .form-radios,
  253. [dir="rtl"] .comment-form .form-item .description {
  254. margin-right: 120px;
  255. margin-left: 0;
  256. }
  257. .comment-form .form-type-checkbox label,
  258. .comment-form .form-radios label {
  259. float: none;
  260. margin-top: 0;
  261. }
  262. .comment-form input.form-file {
  263. width: auto;
  264. }
  265. .layout-no-sidebars .comment-form .form-text {
  266. width: 800px;
  267. }
  268. .layout-one-sidebar .comment-form .form-text {
  269. width: 500px;
  270. }
  271. .layout-two-sidebars .comment-form .form-text {
  272. width: 320px;
  273. }
  274. .comment-form .form-item .description {
  275. margin-left: 120px; /* LTR */
  276. font-size: 0.786em;
  277. line-height: 1.2;
  278. }
  279. .comment-form .form-textarea {
  280. border-top-left-radius: 4px;
  281. border-top-right-radius: 4px;
  282. }
  283. .comment-form details.filter-wrapper .details-wrapper,
  284. .comment-form .text-format-wrapper .form-item {
  285. margin-top: 0;
  286. margin-bottom: 0;
  287. }
  288. .filter-wrapper label {
  289. float: none;
  290. width: auto;
  291. }
  292. .filter-wrapper .form-select {
  293. min-width: 120px;
  294. }
  295. .comment-form details.filter-wrapper .tips {
  296. font-size: 0.786em;
  297. }
  298. #comment-body-add-more-wrapper .form-type-textarea label {
  299. margin-bottom: 0.4em;
  300. }
  301. #edit-actions input {
  302. margin-right: 0.6em; /* LTR */
  303. }
  304. [dir="rtl"] #edit-actions input {
  305. margin-right: 0;
  306. margin-left: 0.6em;
  307. }
  308. /* Form error styles. */
  309. .form-item textarea.error + .cke {
  310. border: 2px solid red;
  311. }
  312. .form-item textarea.error + .ck-editor > .ck-editor__main {
  313. border: 2px solid red;
  314. }
  315. /* Form error message styles. */
  316. .form-item--error-message {
  317. color: #e32700;
  318. }
  319. /**
  320. * Improve form element usability on narrow devices.
  321. */
  322. @media all and (max-width: 600px) {
  323. .form-actions .button {
  324. display: block;
  325. float: none;
  326. -webkit-box-sizing: border-box;
  327. -moz-box-sizing: border-box;
  328. box-sizing: border-box;
  329. width: 100%;
  330. margin: 10px 0 0;
  331. padding-bottom: 6px;
  332. }
  333. .js .dropbutton .dropbutton-action > input,
  334. .js .dropbutton .dropbutton-action > a,
  335. .js .dropbutton .dropbutton-action > button {
  336. padding-left: 3em;
  337. text-align: center;
  338. }
  339. }

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