action-sheet.css 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. uni-actionsheet {
  2. display: block;
  3. box-sizing: border-box;
  4. }
  5. .uni-actionsheet {
  6. position: fixed;
  7. left: 6px;
  8. right: 6px;
  9. bottom: 6px;
  10. transform: translate(0, 100%);
  11. backface-visibility: hidden;
  12. z-index: 999;
  13. visibility: hidden;
  14. transition: transform 0.3s, visibility 0.3s;
  15. }
  16. .uni-actionsheet.uni-actionsheet_toggle {
  17. visibility: visible;
  18. transform: translate(0, 0);
  19. }
  20. .uni-actionsheet * {
  21. box-sizing: border-box;
  22. }
  23. .uni-actionsheet__menu,
  24. .uni-actionsheet__action {
  25. border-radius: 5px;
  26. background-color: #fcfcfd;
  27. }
  28. .uni-actionsheet__action {
  29. margin-top: 6px;
  30. }
  31. .uni-actionsheet__cell,
  32. .uni-actionsheet__title {
  33. position: relative;
  34. padding: 10px 6px;
  35. text-align: center;
  36. font-size: 18px;
  37. text-overflow: ellipsis;
  38. overflow: hidden;
  39. cursor: pointer;
  40. }
  41. .uni-actionsheet__title {
  42. position: absolute;
  43. top: 0;
  44. right: 0;
  45. left: 0;
  46. z-index: 1;
  47. color: var(--UI-FG);
  48. background-color: #fff;
  49. border-radius: 5px 5px 0 0;
  50. border-bottom: 1px solid #e5e5e5;
  51. }
  52. .uni-actionsheet__cell:before {
  53. content: ' ';
  54. position: absolute;
  55. left: 0;
  56. top: 0;
  57. right: 0;
  58. height: 1px;
  59. border-top: 1px solid #e5e5e5;
  60. color: #e5e5e5;
  61. transform-origin: 0 0;
  62. transform: scaleY(0.5);
  63. }
  64. .uni-actionsheet__cell:active {
  65. background-color: #ececec;
  66. }
  67. .uni-actionsheet__cell:first-child:before {
  68. display: none;
  69. }
  70. @media screen and (min-width: 500px) and (min-height: 500px) {
  71. .uni-mask.uni-actionsheet__mask {
  72. background: none;
  73. }
  74. .uni-actionsheet {
  75. width: 300px;
  76. left: 50%;
  77. right: auto;
  78. top: 50%;
  79. bottom: auto;
  80. transform: translate(-50%, -50%);
  81. opacity: 0;
  82. transition: opacity 0.3s, visibility 0.3s;
  83. }
  84. .uni-actionsheet.uni-actionsheet_toggle {
  85. opacity: 1;
  86. transform: translate(-50%, -50%);
  87. }
  88. .uni-actionsheet__menu {
  89. box-shadow: 0px 0 20px 5px rgba(0, 0, 0, 0.3);
  90. }
  91. .uni-actionsheet__action {
  92. display: none;
  93. }
  94. }
  95. @media (prefers-color-scheme: dark) {
  96. .uni-actionsheet__title {
  97. background-color: var(--UI-BG-1);
  98. border-bottom-color: var(--UI-BORDER-COLOR-1);
  99. }
  100. body .uni-actionsheet {
  101. background-color: var(--UI-BG-1);
  102. }
  103. .uni-actionsheet__action,
  104. body .uni-actionsheet__menu {
  105. background-color: var(--UI-BG-2);
  106. }
  107. .uni-actionsheet__cell:active {
  108. background-color: var(--UI-BG-COLOR-ACTIVE);
  109. }
  110. .uni-actionsheet__cell:before {
  111. border-top-color: var(--UI-BORDER-COLOR-1);
  112. color: var(--UI-BORDER-COLOR-1);
  113. }
  114. }