_autocomplete.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #conversejs {
  2. [hidden] { display: none; }
  3. .visually-hidden {
  4. position: absolute;
  5. clip: rect(0, 0, 0, 0);
  6. }
  7. .form-group {
  8. .suggestion-box {
  9. width: 100%;
  10. }
  11. }
  12. .suggestion-box {
  13. position: relative;
  14. mark {
  15. background: var(--completion-light-color);
  16. }
  17. > input {
  18. display: block;
  19. }
  20. .suggestion-box__results,
  21. > ul {
  22. &:before {
  23. content: "";
  24. position: absolute;
  25. top: -.43em;
  26. left: 1em;
  27. width: 0; height: 0;
  28. padding: .4em;
  29. background: white;
  30. border: inherit;
  31. border-right: 0;
  32. border-bottom: 0;
  33. -webkit-transform: rotate(45deg);
  34. transform: rotate(45deg);
  35. z-index: -1;
  36. }
  37. position: absolute;
  38. left: 0;
  39. right: 0;
  40. z-index: 2;
  41. min-width: 100%;
  42. box-sizing: border-box;
  43. list-style: none;
  44. padding: 0;
  45. border-radius: .3em;
  46. margin: .2em 0 0;
  47. background: hsla(0,0%,100%,.9);
  48. background: linear-gradient(to bottom right, white, hsla(0,0%,100%,.9));
  49. border: 1px solid rgba(0,0,0,.3);
  50. box-shadow: .05em .2em .6em rgba(0,0,0,.1);
  51. text-shadow: none;
  52. > li {
  53. text-overflow: ellipsis;
  54. overflow-x: hidden;
  55. position: relative;
  56. cursor: pointer;
  57. padding: 1em;
  58. }
  59. }
  60. .suggestion-box__results--below {
  61. top: 2em;
  62. }
  63. .suggestion-box__results--above {
  64. bottom: 4.5em;
  65. &:before {
  66. display: none;
  67. }
  68. &:after {
  69. z-index: -1;
  70. content: "";
  71. position: absolute;
  72. bottom: -0.43em;
  73. left: 1em;
  74. width: 0;
  75. height: 0;
  76. padding: 0.4em;
  77. background: white;
  78. border: inherit;
  79. border-left: 0;
  80. border-top: 0;
  81. -webkit-transform: rotate(45deg);
  82. transform: rotate(45deg);
  83. }
  84. }
  85. }
  86. .suggestion-box > ul[hidden],
  87. .suggestion-box > ul:empty {
  88. display: none;
  89. }
  90. @supports (transform: scale(0)) {
  91. .suggestion-box > ul {
  92. transition: .3s cubic-bezier(.4,.2,.5,1.4);
  93. transform-origin: 1.43em -.43em;
  94. }
  95. .suggestion-box > ul[hidden],
  96. .suggestion-box > ul:empty {
  97. opacity: 0;
  98. transform: scale(0);
  99. display: block;
  100. transition-timing-function: ease;
  101. }
  102. }
  103. .suggestion-box > ul > li[aria-selected="true"] {
  104. background: var(--completion-dark-color);
  105. color: var(--inverse-link-color);
  106. }
  107. .suggestion-box li:hover mark {
  108. background: var(--completion-light-color);
  109. color: var(--inverse-link-color);
  110. }
  111. .suggestion-box li[aria-selected="true"] mark {
  112. background: var(--completion-normal-color);
  113. color: inherit;
  114. }
  115. }
  116. #conversejs.converse-fullscreen {
  117. .suggestion-box__results--above {
  118. bottom: 4.5em;
  119. }
  120. }
  121. #conversejs.converse-overlayed {
  122. .suggestion-box__results--above {
  123. bottom: 3.5em;
  124. }
  125. }