form--text.pcss.css

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

Text and textarea input elements.

File

core/themes/claro/css/components/form--text.pcss.css

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

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