popover.wxss 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* myComponents/popover2/popover.wxss */
  2. .myPopover{
  3. position: relative;
  4. /* width: auto;
  5. height: auto; */
  6. }
  7. .popoverView{
  8. width: auto;
  9. height: auto;
  10. max-height: 100px;
  11. padding: 10px;
  12. position: absolute;
  13. background-color: white;
  14. box-shadow: 0 0 2px 2px #ddd;
  15. border-radius: 6rpx;
  16. z-index: 999999;
  17. }
  18. .popoverView.top{
  19. bottom: 30px;
  20. right: calc(100% - 20px);
  21. }
  22. .popoverView.bottom{
  23. top: 35px;
  24. right: calc(100% - 20px);
  25. }
  26. .popoverView::before{
  27. position: absolute;
  28. display: inline-block;
  29. width: 0;
  30. height: 0px;
  31. content: '';
  32. border-style: solid;
  33. border-width: 6px;
  34. border-color: #fff #fff transparent transparent;
  35. box-shadow: 2px -2px 2px #ddd;
  36. border-top-style: solid;
  37. border-right-style: solid;
  38. border-bottom-style: solid;
  39. border-left-style: solid;
  40. border-top-width: 6px;
  41. border-right-width: 6px;
  42. border-bottom-width: 6px;
  43. border-left-width: 6px;
  44. border-top-color: rgb(255, 255, 255);
  45. border-right-color: rgb(255, 255, 255);
  46. border-bottom-color: transparent;
  47. border-left-color: transparent;
  48. }
  49. .popoverView.top::before {
  50. bottom: -6px;
  51. right: 10px;
  52. transform: rotate(135deg);
  53. }
  54. .popoverView.left::before {
  55. right: 20px;
  56. }
  57. .popoverView.bottom::before {
  58. top: -6px;
  59. right: 10px;
  60. transform: rotate(-45deg);
  61. }