_form_select_box.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. $select-input-height: 35px;
  2. $select-menu-max-height: 300px;
  3. $select-item-font-size: $font-size-base;
  4. $select-item-bg: $dropdownBackground;
  5. $select-item-fg: $input-color;
  6. $select-option-bg: $dropdownBackground;
  7. $select-option-color: $input-color;
  8. $select-noresults-color: $text-color;
  9. $select-input-bg: $input-bg;
  10. $select-input-border-color: $input-border-color;
  11. $select-menu-box-shadow: $menu-dropdown-shadow;
  12. $select-text-color: $text-color;
  13. $select-input-bg-disabled: $input-bg-disabled;
  14. $select-option-selected-bg: $dropdownLinkBackgroundActive;
  15. @import '../../../node_modules/react-select/scss/default.scss';
  16. @mixin select-control() {
  17. width: 100%;
  18. margin-right: $gf-form-margin;
  19. @include border-radius($input-border-radius-sm);
  20. background-color: $input-bg;
  21. }
  22. @mixin select-control-focus() {
  23. border-color: $input-border-focus;
  24. outline: none;
  25. $shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px $input-box-shadow-focus;
  26. @include box-shadow($shadow);
  27. }
  28. // react-select tweaks
  29. .gf-form-input--form-dropdown {
  30. padding: 0;
  31. border: 0;
  32. overflow: visible;
  33. .Select-placeholder {
  34. color: $input-color-placeholder;
  35. }
  36. .Select-menu-outer {
  37. right: 0;
  38. }
  39. > .Select-control {
  40. @include select-control();
  41. border-color: $dark-3;
  42. input {
  43. min-width: 1rem;
  44. }
  45. .Select-clear,
  46. .Select-arrow {
  47. margin-right: 8px;
  48. }
  49. .Select-value {
  50. display: inline-block;
  51. padding: $input-padding-y $input-padding-x;
  52. font-size: $font-size-md;
  53. line-height: $input-line-height;
  54. vertical-align: baseline;
  55. white-space: nowrap;
  56. }
  57. }
  58. &.is-open > .Select-control {
  59. background: transparent;
  60. border-color: $dark-3;
  61. }
  62. &.is-focused > .Select-control {
  63. background-color: $input-bg;
  64. @include select-control-focus();
  65. }
  66. &.is-focused:not(.is-open) > .Select-control {
  67. background-color: $input-bg;
  68. @include select-control-focus();
  69. }
  70. .Select-menu-outer {
  71. border: 0;
  72. width: auto;
  73. }
  74. .Select-option.is-focused {
  75. background-color: $dropdownLinkBackgroundHover;
  76. color: $dropdownLinkColorHover;
  77. &::before {
  78. position: absolute;
  79. left: 0;
  80. top: 0;
  81. height: 100%;
  82. width: 2px;
  83. display: block;
  84. content: '';
  85. background-image: linear-gradient(to bottom, #ffd500 0%, #ff4400 99%, #ff4400 100%);
  86. }
  87. }
  88. }