form.pcss.css

Same filename in this branch
  1. 11.x core/themes/olivero/css/components/form.pcss.css
  2. 11.x core/themes/claro/css/components/form.pcss.css
Same filename in other branches
  1. 9 core/themes/olivero/css/components/form.pcss.css
  2. 9 core/themes/claro/css/components/form.pcss.css
  3. 8.9.x core/themes/claro/css/components/form.pcss.css
  4. 10 core/misc/dialog/off-canvas/css/form.pcss.css
  5. 10 core/themes/olivero/css/components/form.pcss.css
  6. 10 core/themes/claro/css/components/form.pcss.css

Visual styling for forms in the off-canvas dialog.

@internal

File

core/misc/dialog/off-canvas/css/form.pcss.css

View source
  1. /**
  2. * @file
  3. * Visual styling for forms in the off-canvas dialog.
  4. *
  5. * @internal
  6. */
  7. #drupal-off-canvas-wrapper {
  8. --drupal-off-canvas-input-padding: var(--off-canvas-vertical-spacing-unit);
  9. --drupal-off-canvas-input-background-color: #fff;
  10. --drupal-off-canvas-input-border: solid 1px transparent;
  11. --drupal-off-canvas-input-border-radius: 2px;
  12. --drupal-off-canvas-input-font-size: 14px;
  13. --drupal-off-canvas-input-text-color: #333;
  14. --drupal-off-canvas-fieldset-background-color: transparent;
  15. --drupal-off-canvas-fieldset-border-width: 1px;
  16. --drupal-off-canvas-fieldset-border-color: var(--off-canvas-border-color);
  17. & form {
  18. padding-block: var(--off-canvas-padding);
  19. & > *:first-child {
  20. margin-top: 0;
  21. padding-top: 0;
  22. }
  23. }
  24. & .ck-content {
  25. color: var(--drupal-off-canvas-input-text-color);
  26. }
  27. & .form-item:where(:not(fieldset)) {
  28. padding: var(--off-canvas-vertical-spacing-unit) 0;
  29. }
  30. & .form-items-inline > * {
  31. display: inline-block;
  32. }
  33. & label {
  34. display: block;
  35. }
  36. & .form-type-boolean {
  37. padding: calc(0.5 * var(--off-canvas-vertical-spacing-unit)) 0;
  38. }
  39. & .description,
  40. & .form-item__description {
  41. margin: calc(0.5 * var(--off-canvas-vertical-spacing-unit)) 0;
  42. font-size: 12px;
  43. }
  44. & .form-required::after {
  45. content: "*";
  46. }
  47. & .fieldset,
  48. & fieldset {
  49. margin: calc(2 * var(--off-canvas-vertical-spacing-unit)) 0;
  50. padding: var(--off-canvas-vertical-spacing-unit);
  51. border: solid var(--drupal-off-canvas-fieldset-border-width) var(--drupal-off-canvas-fieldset-border-color);
  52. background-color: var(--drupal-off-canvas-fieldset-background-color);
  53. }
  54. & legend, /* Bartik doesn't apply BEM classes, so we use the element. */
  55. & .fieldset__legend {
  56. display: contents;
  57. font-weight: bold;
  58. }
  59. & :is(.fieldset, fieldset, .draggable-table) input:where(:not([type="submit"], [type="checkbox"], [type="radio"])) {
  60. width: 100%; /* Prevent text fields from breaking out of tables and fieldsets at narrow widths. */
  61. }
  62. & input,
  63. & textarea {
  64. font-family: inherit;
  65. }
  66. & input:where(:not([type="submit"], [type="checkbox"], [type="radio"], [type="file"])),
  67. & select,
  68. & textarea {
  69. max-width: 100%;
  70. padding: var(--drupal-off-canvas-input-padding);
  71. color: var(--drupal-off-canvas-input-text-color);
  72. border: var(--drupal-off-canvas-input-border);
  73. border-radius: var(--drupal-off-canvas-input-border-radius);
  74. background-color: var(--drupal-off-canvas-input-background-color);
  75. font-size: var(--drupal-off-canvas-input-font-size);
  76. }
  77. & input[type="checkbox"],
  78. & input[type="radio"] {
  79. & + label {
  80. display: inline;
  81. }
  82. }
  83. & input[type="file"] {
  84. margin-bottom: var(--off-canvas-vertical-spacing-unit);
  85. }
  86. & input[type="search"] {
  87. appearance: none; /* Necessary for Safari. */
  88. }
  89. & select {
  90. appearance: none;
  91. padding-inline-end: 20px;
  92. border: var(--drupal-off-canvas-input-border);
  93. border-radius: var(--drupal-off-canvas-input-border-radius);
  94. background-image: url(../../../icons/545560/chevron-down.svg);
  95. background-repeat: no-repeat;
  96. background-position: center right 5px; /* LTR */
  97. background-size: 12px;
  98. &:dir(rtl) {
  99. background-position: center left 5px;
  100. }
  101. @media (forced-colors: active) {
  102. appearance: revert;
  103. padding-inline-end: 0;
  104. background: revert;
  105. }
  106. }
  107. /*
  108. * Autocomplete.
  109. */
  110. & .form-autocomplete {
  111. padding-inline-end: 40px; /* Room for icon. */
  112. background-image: url(../../../icons/868686/magnifier.svg);
  113. background-repeat: no-repeat;
  114. background-position: center right 1px; /* LTR */
  115. &.ui-autocomplete-loading {
  116. background-image: url(../../../icons/spinner.gif);
  117. }
  118. &:dir(rtl) {
  119. background-position: center left 1px;
  120. }
  121. }
  122. /* This is the background
      for the autocomplete dropdown. */
    • & .ui-autocomplete {
    • margin: 0;
    • padding: 0;
    • list-style: none;
    • border: var(--drupal-off-canvas-input-border);
    • background-color: var(--drupal-off-canvas-input-background-color);
    • box-shadow: 0 1px 1px 0 var(--off-canvas-background-color); /* Ensure edge is visible if appearing over another form element. */
    • & a {
    • display: block;
    • padding: var(--drupal-off-canvas-input-padding);
    • cursor: pointer;
    • color: var(--drupal-off-canvas-input-text-color);
    • font-size: var(--drupal-off-canvas-input-font-size);
    • &:hover {
    • background-color: #eee;
    • }
    • &:focus,
    • &.ui-state-active {
    • outline: solid 2px currentColor;
    • outline-offset: -2px;
    • }
    • }
    • }
    • /*
    • * Claro injects a "Loading" autocomplete message that affects the positioning
    • * of the ui-autocomplete dropdown. We remove this to normalize the markup.
    • */
    • & .claro-autocomplete__message {
    • display: none;
    • }
    • }

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