form--select.pcss.css

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

Select input elements.

File

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

View source
  1. /**
  2. * @file
  3. * Select input elements.
  4. */
  5. @import "../base/variables.pcss.css";
  6. .form-element--type-select {
  7. padding-right: calc(2rem - var(--input-border-size));
  8. background-image: url(../../images/icons/545560/chevron-down.svg);
  9. background-repeat: no-repeat;
  10. background-position: 100% 50%;
  11. background-size: 2.75rem 0.5625rem; /* w: 14px + (2 * 15px), h: 9px */
  12. }
  13. [dir="rtl"] .form-element--type-select {
  14. padding-right: calc(1rem - var(--input-border-size));
  15. padding-left: calc(2rem - var(--input-border-size));
  16. background-position: 0 50%;
  17. }
  18. .no-touchevents .form-element--type-select.form-element--extrasmall,
  19. .no-touchevents .form-element--type-select[name$="][_weight]"] {
  20. padding-right: calc(1.5rem - var(--input-border-size));
  21. background-size: 1.75rem 0.4375rem; /* w: 14px + (2 * 7px), h: 7px */
  22. }
  23. [dir="rtl"].no-touchevents .form-element--type-select.form-element--extrasmall,
  24. [dir="rtl"].no-touchevents .form-element--type-select[name$="][_weight]"] {
  25. padding-right: calc(0.5rem - var(--input-border-size));
  26. padding-left: calc(1.5rem - var(--input-border-size));
  27. }
  28. .form-element--type-select::-ms-expand {
  29. display: none;
  30. }
  31. /**
  32. * Select states.
  33. */
  34. .form-element--type-select:focus {
  35. background-image: url(../../images/icons/003ecc/chevron-down.svg);
  36. }
  37. .form-element--type-select[disabled] {
  38. background-image: url(../../images/icons/8e929c/chevron-down.svg);
  39. }
  40. /* Necessary to show chevron in forced colors mode in modern browsers. */
  41. @media (forced-colors: active) {
  42. .form-element--type-select,
  43. .form-element--type-select:focus,
  44. .form-element--type-select[disabled] {
  45. padding-right: var(--input-padding-horizontal);
  46. background-image: none;
  47. appearance: listbox; /* Default appearance value for modern browsers. */
  48. /* Lets browser set appearance to whatever the browser's default is. */
  49. @supports (appearance: revert) {
  50. appearance: revert;
  51. }
  52. }
  53. }
  54. /* Necessary for Internet Explorer to show chevron. */
  55. @media screen and (-ms-high-contrast: active) {
  56. .form-element--type-select,
  57. .form-element--type-select:focus,
  58. .form-element--type-select[disabled] {
  59. padding-right: var(--input-padding-horizontal);
  60. /* Re-enable default chevron for Internet Explorer. */
  61. &::-ms-expand {
  62. display: block;
  63. }
  64. }
  65. }

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