_form_select_box.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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-control {
  37. @include select-control();
  38. border-color: $dark-3;
  39. input {
  40. min-width: 1rem;
  41. }
  42. .Select-clear,
  43. .Select-arrow {
  44. margin-right: 8px;
  45. }
  46. .Select-value {
  47. display: inline-block;
  48. padding: $input-padding-y $input-padding-x;
  49. font-size: $font-size-md;
  50. line-height: $input-line-height;
  51. vertical-align: baseline;
  52. white-space: nowrap;
  53. }
  54. }
  55. &.is-open > .Select-control {
  56. background: transparent;
  57. border-color: $dark-3;
  58. }
  59. &.is-focused > .Select-control {
  60. background-color: $input-bg;
  61. @include select-control-focus();
  62. }
  63. &.is-focused:not(.is-open) > .Select-control {
  64. background-color: $input-bg;
  65. @include select-control-focus();
  66. }
  67. .Select-menu-outer {
  68. border: 0;
  69. width: auto;
  70. }
  71. .Select-option.is-focused {
  72. background-color: $dropdownLinkBackgroundHover;
  73. color: $dropdownLinkColorHover;
  74. &::before {
  75. position: absolute;
  76. left: 0;
  77. top: 0;
  78. height: 100%;
  79. width: 2px;
  80. display: block;
  81. content: '';
  82. background-image: linear-gradient(to bottom, #ffd500 0%, #ff4400 99%, #ff4400 100%);
  83. }
  84. }
  85. }
  86. .gf-form-input--form-dropdown-right {
  87. .Select-menu-outer {
  88. right: 0;
  89. }
  90. }