form--text.css

Same filename in other branches
  1. 9 core/themes/claro/css/components/form--text.css
  2. 8.9.x core/themes/claro/css/components/form--text.css
  3. 10 core/themes/claro/css/components/form--text.css

Text and textarea input elements.

File

core/themes/claro/css/components/form--text.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. * Text and textarea input elements.
  10. */
  11. .form-element {
  12. box-sizing: border-box;
  13. max-width: 100%;
  14. min-height: calc(((var(--input-padding-vertical) + var(--input-border-size)) * 2) + var(--input-line-height)); /* iOS. */
  15. padding: var(--input-padding-vertical) var(--input-padding-horizontal);
  16. color: var(--input-fg-color);
  17. border: var(--input-border-size) solid var(--input-border-color);
  18. border-radius: var(--input-border-radius-size);
  19. background: var(--input-bg-color);
  20. font-size: var(--input-font-size);
  21. line-height: var(--input-line-height);
  22. appearance: none; /* Being able to control inner box shadow on iOS. */
  23. }
  24. .no-touchevents .form-element--extrasmall,
  25. .no-touchevents .form-element[name$="][_weight]"] {
  26. min-height: calc(((var(--input--extrasmall-padding-vertical) + var(--input-border-size)) * 2) + var(--input--extrasmall-line-height)); /* iOS. */
  27. padding: var(--input--extrasmall-padding-vertical) var(--input--extrasmall-padding-horizontal);
  28. font-size: var(--input--extrasmall-font-size);
  29. line-height: var(--input--extrasmall-line-height);
  30. }
  31. /**
  32. * Override normalize.css's search appearance.
  33. */
  34. .form-element--type-search[type="search"] {
  35. appearance: none;
  36. box-sizing: border-box;
  37. }
  38. /**
  39. * Fix minor things for specific types.
  40. */
  41. .form-element--type-date,
  42. .form-element--type-time {
  43. vertical-align: -webkit-baseline-middle; /* Prevent iOS input jump while filling. */
  44. }
  45. .form-element--type-date {
  46. min-width: 9.5rem; /* Prevent input width change while filling. */
  47. }
  48. .form-element--type-time {
  49. min-width: 7.5rem; /* Prevent input width change while filling. */
  50. }
  51. .form-element--type-color {
  52. min-width: 3rem; /* Bigger input for webkit */
  53. padding: 0; /* Bigger pickable area */
  54. text-indent: calc(0.75rem - var(--input-border-size)); /* Text-input fallback for non-supporting browsers like Safari */
  55. }
  56. /**
  57. * Better upload button alignment for Chrome.
  58. */
  59. .form-element--type-file::-webkit-file-upload-button {
  60. vertical-align: top;
  61. }
  62. /**
  63. * States.
  64. */
  65. .form-element:active {
  66. border-color: var(--input--focus-border-color);
  67. }
  68. .form-element:hover {
  69. border-color: var(--input--hover-border-color);
  70. box-shadow: inset 0 0 0 var(--input-border-size) var(--input--hover-border-color);
  71. }
  72. .form-element:focus {
  73. box-shadow:
  74. 0 0 0 2px var(--color-white),
  75. 0 0 0 5px var(--color-focus);
  76. }
  77. .form-element:hover:focus {
  78. box-shadow:
  79. 0 0 0 2px var(--color-white),
  80. 0 0 0 5px var(--color-focus),
  81. inset 0 0 0 var(--input-border-size) var(--input--hover-border-color);
  82. }
  83. .form-element.error {
  84. border-width: var(--input--error-border-size);
  85. border-color: var(--input--error-border-color);
  86. }
  87. .form-element.error:hover {
  88. box-shadow: none;
  89. }
  90. .form-element.error:hover:focus {
  91. box-shadow:
  92. 0 0 0 2px var(--color-white),
  93. 0 0 0 5px var(--color-focus);
  94. }
  95. .form-element--type-textarea.error + .cke {
  96. border-color: var(--input--error-border-color);
  97. }
  98. .form-element[disabled] {
  99. color: var(--input--disabled-fg-color);
  100. border-color: var(--input--disabled-border-color);
  101. background-color: var(--input--disabled-bg-color);
  102. box-shadow: none;
  103. /* https://stackoverflow.com/q/262158#answer-23511280 */
  104. -webkit-text-fill-color: var(--input--disabled-fg-color);
  105. }
  106. /**
  107. * Improve form element usability on narrow devices.
  108. */
  109. @media screen and (max-width: 37.5rem) {
  110. /* Number, date and time are skipped here */
  111. .form-element {
  112. float: none;
  113. width: 100%;
  114. margin-block-start: 0.75rem;
  115. margin-inline: 0;
  116. }
  117. .form-element:first-child,
  118. .form-item__label + .form-element {
  119. margin-block-start: 0;
  120. }
  121. }
  122. .form-element--type-textarea.error + .ck-editor > .ck-editor__main {
  123. border: var(--input--error-border-size) solid var(--input--error-border-color);
  124. }

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