_form_select_box.scss 2.3 KB

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