form-select.pcss.css

Same filename in other branches
  1. 10 core/themes/olivero/css/components/form-select.pcss.css
  2. 11.x 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/variables.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--gray-0);
  16. border: 1px solid var(--color--gray-30);
  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--blue-50);
  27. outline: solid 2px var(--color--blue-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. /* Hides default chevron within Internet Explorer. */
  36. &::-ms-expand {
  37. display: none;
  38. }
  39. &[disabled] {
  40. color: var(--color--gray-30);
  41. background-color: var(--color--gray-90);
  42. }
  43. &.error {
  44. border: solid 2px var(--color--red);
  45. &:focus {
  46. outline-color: var(--color--red);
  47. }
  48. }
  49. &[multiple] {
  50. height: auto;
  51. padding: var(--sp0-5);
  52. background-image: none;
  53. line-height: 1; /* Needed by non-Chromium based MS Edge browsers. */
  54. & option {
  55. padding: var(--sp0-5);
  56. }
  57. }
  58. &.form-element--small {
  59. height: var(--sp2-5);
  60. }
  61. /* Necessary to show chevron in forced colors mode in modern browsers. */
  62. @media (forced-colors: active) {
  63. padding-inline-end: var(--sp);
  64. background-image: none;
  65. appearance: listbox; /* Default appearance value for modern browsers. */
  66. /* Lets browser set appearance to whatever the browser's default is. */
  67. @supports (appearance: revert) {
  68. appearance: revert;
  69. }
  70. }
  71. /* Necessary for Internet Explorer to show chevron. */
  72. @media screen and (-ms-high-contrast: active) {
  73. padding-inline-end: 0;
  74. /* Re-enable default chevron for Internet Explorer. */
  75. &::-ms-expand {
  76. display: block;
  77. }
  78. }
  79. }
  80. [dir="rtl"] select {
  81. background-position: left var(--sp) center;
  82. }

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