form-select.pcss.css

Same filename in other branches
  1. 9 core/themes/olivero/css/components/form-select.pcss.css
  2. 10 core/themes/olivero/css/components/form-select.pcss.css

Select input elements.

File

core/themes/olivero/css/components/form-select.pcss.css

View source
  1. /**
  2. * @file
  3. * Select input elements.
  4. */
  5. @import "../base/media-queries.pcss.css";
  6. :root {
  7. --form-element-select-icon: url("../../images/chevron-down.svg");
  8. }
  9. select {
  10. max-width: 100%;
  11. height: var(--sp3);
  12. padding-block: 0;
  13. padding-inline-start: var(--sp);
  14. padding-inline-end: var(--sp3);
  15. color: var(--color-text-neutral-loud);
  16. border: 1px solid var(--color--gray-60);
  17. border-radius: var(--border-radius);
  18. background-color: var(--color--white);
  19. background-image: var(--form-element-select-icon);
  20. background-repeat: no-repeat;
  21. background-position: right var(--sp) center; /* LTR */
  22. font-family: inherit;
  23. font-size: inherit;
  24. appearance: none;
  25. &:focus {
  26. border: solid 2px var(--color--primary-50);
  27. outline: solid 2px var(--color--primary-50);
  28. @supports (outline-style: double) {
  29. border-width: 1px;
  30. outline-width: 6px;
  31. outline-style: double;
  32. outline-offset: -1px;
  33. }
  34. }
  35. &[disabled] {
  36. color: var(--color--gray-60);
  37. background-color: var(--color--gray-100);
  38. }
  39. &.error {
  40. border: solid 2px var(--color--red);
  41. &:focus {
  42. outline-color: var(--color--red);
  43. }
  44. }
  45. &[multiple] {
  46. height: auto;
  47. padding: var(--sp0-5);
  48. background-image: none;
  49. line-height: 1; /* Needed by non-Chromium based MS Edge browsers. */
  50. & option {
  51. padding: var(--sp0-5);
  52. }
  53. }
  54. &.form-element--small {
  55. height: var(--sp2-5);
  56. }
  57. /* Necessary to show chevron in forced colors mode in modern browsers. */
  58. @media (forced-colors: active) {
  59. padding-inline-end: var(--sp);
  60. background-image: none;
  61. appearance: listbox; /* Default appearance value for modern browsers. */
  62. /* Lets browser set appearance to whatever the browser's default is. */
  63. @supports (appearance: revert) {
  64. appearance: revert;
  65. }
  66. }
  67. }
  68. [dir="rtl"] select {
  69. background-position: left var(--sp) center;
  70. }

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