index.less 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .@{wux-prefix}-popover {
  4. font-family: Monospaced Number, Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif;
  5. font-size: @popover-font-size;
  6. line-height: @popover-line-height;
  7. color: @text-color;
  8. box-sizing: border-box;
  9. margin: 0;
  10. padding: 0;
  11. list-style: none;
  12. position: absolute;
  13. top: 0;
  14. left: 0;
  15. z-index: @z-index-popover;
  16. cursor: auto;
  17. user-select: text;
  18. white-space: normal;
  19. font-weight: 400;
  20. text-align: left;
  21. &::after {
  22. content: "";
  23. position: absolute;
  24. background: fade(@white, 1%);
  25. }
  26. &__container {
  27. position: absolute;
  28. top: 0;
  29. left: 0;
  30. width: 100%;
  31. }
  32. &__element {
  33. display: inline-block;
  34. line-height: 1;
  35. }
  36. &--theme-dark &__inner {
  37. background-color: @popover-dark-bg;
  38. }
  39. &--theme-dark&--placement-top &__arrow,
  40. &--theme-dark&--placement-topLeft &__arrow,
  41. &--theme-dark&--placement-topRight &__arrow {
  42. border-top-color: @popover-dark-bg;
  43. }
  44. &--theme-dark&--placement-right &__arrow,
  45. &--theme-dark&--placement-rightBottom &__arrow,
  46. &--theme-dark&--placement-rightTop &__arrow {
  47. border-right-color: @popover-dark-bg;
  48. }
  49. &--theme-dark&--placement-bottom &__arrow,
  50. &--theme-dark&--placement-bottomLeft &__arrow,
  51. &--theme-dark&--placement-bottomRight &__arrow {
  52. border-bottom-color: @popover-dark-bg;
  53. }
  54. &--theme-dark&--placement-left &__arrow,
  55. &--theme-dark&--placement-leftBottom &__arrow,
  56. &--theme-dark&--placement-leftTop &__arrow {
  57. border-left-color: @popover-dark-bg;
  58. }
  59. &--theme-dark &__inner,
  60. &--theme-dark &__title {
  61. color: @popover-dark-color;
  62. }
  63. &--placement-top,
  64. &--placement-topLeft,
  65. &--placement-topRight {
  66. padding-bottom: @popover-distance;
  67. }
  68. &--placement-right,
  69. &--placement-rightBottom,
  70. &--placement-rightTop {
  71. padding-left: @popover-distance;
  72. }
  73. &--placement-bottom,
  74. &--placement-bottomLeft,
  75. &--placement-bottomRight {
  76. padding-top: @popover-distance;
  77. }
  78. &--placement-left,
  79. &--placement-leftBottom,
  80. &--placement-leftTop {
  81. padding-right: @popover-distance;
  82. }
  83. &__inner {
  84. background-color: @popover-bg;
  85. background-clip: padding-box;
  86. border-radius: @popover-radius;
  87. box-shadow: @box-shadow-base;
  88. color: @text-color;
  89. }
  90. &__title {
  91. position: relative;
  92. min-width: @popover-min-width;
  93. margin: 0;
  94. padding: 5px 16px 4px;
  95. min-height: 32px;
  96. box-sizing: border-box;
  97. color: @heading-color;
  98. font-weight: 500;
  99. &::after {
  100. .setBottomLine(@border-color-split);
  101. }
  102. }
  103. &__inner-content {
  104. padding: 12px 16px;
  105. }
  106. &__arrow {
  107. width: 0;
  108. height: 0;
  109. position: absolute;
  110. display: block;
  111. border-color: transparent;
  112. border-style: solid;
  113. border-width: sqrt(@popover-arrow-width * @popover-arrow-width * 2);
  114. }
  115. &--placement-top &__arrow,
  116. &--placement-topLeft &__arrow,
  117. &--placement-topRight &__arrow {
  118. bottom: 4px;
  119. border-bottom-width: 0;
  120. border-top-color: @popover-bg;
  121. }
  122. &--placement-top &__arrow {
  123. left: 50%;
  124. transform: translateX(-50%);
  125. }
  126. &--placement-topLeft &__arrow {
  127. left: 16px;
  128. }
  129. &--placement-topRight &__arrow {
  130. right: 16px;
  131. }
  132. &--placement-right &__arrow,
  133. &--placement-rightBottom &__arrow,
  134. &--placement-rightTop &__arrow {
  135. left: 4px;
  136. border-left-width: 0;
  137. border-right-color: @popover-bg;
  138. }
  139. &--placement-right &__arrow {
  140. top: 50%;
  141. transform: translateY(-50%);
  142. }
  143. &--placement-rightTop &__arrow {
  144. top: 12px;
  145. }
  146. &--placement-rightBottom &__arrow {
  147. bottom: 12px;
  148. }
  149. &--placement-bottom &__arrow,
  150. &--placement-bottomLeft &__arrow,
  151. &--placement-bottomRight &__arrow {
  152. top: 4px;
  153. border-top-width: 0;
  154. border-bottom-color: @popover-bg;
  155. }
  156. &--placement-bottom &__arrow {
  157. left: 50%;
  158. transform: translateX(-50%);
  159. }
  160. &--placement-bottomLeft &__arrow {
  161. left: 16px;
  162. }
  163. &--placement-bottomRight &__arrow {
  164. right: 16px;
  165. }
  166. &--placement-left &__arrow,
  167. &--placement-leftBottom &__arrow,
  168. &--placement-leftTop &__arrow {
  169. right: 4px;
  170. border-right-width: 0;
  171. border-left-color: @popover-bg;
  172. }
  173. &--placement-left &__arrow {
  174. top: 50%;
  175. transform: translateY(-50%);
  176. }
  177. &--placement-leftTop &__arrow {
  178. top: 12px;
  179. }
  180. &--placement-leftBottom &__arrow {
  181. bottom: 12px;
  182. }
  183. }