tabBar.css 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. uni-tabbar {
  2. display: block;
  3. box-sizing: border-box;
  4. width: 100%;
  5. z-index: 998;
  6. }
  7. .uni-tabbar {
  8. display: flex;
  9. z-index: 998;
  10. box-sizing: border-box;
  11. }
  12. .uni-tabbar-top,
  13. .uni-tabbar-bottom,
  14. .uni-tabbar-top .uni-tabbar,
  15. .uni-tabbar-bottom .uni-tabbar {
  16. position: fixed;
  17. left: var(--window-left);
  18. right: var(--window-right);
  19. }
  20. .uni-app--showlayout + .uni-tabbar-top,
  21. .uni-app--showlayout + .uni-tabbar-bottom,
  22. .uni-app--showlayout + .uni-tabbar-top .uni-tabbar,
  23. .uni-app--showlayout + .uni-tabbar-bottom .uni-tabbar {
  24. left: var(--window-margin);
  25. right: var(--window-margin);
  26. }
  27. .uni-tabbar-bottom .uni-tabbar {
  28. bottom: 0;
  29. padding-bottom: 0;
  30. padding-bottom: constant(safe-area-inset-bottom);
  31. padding-bottom: env(safe-area-inset-bottom);
  32. }
  33. .uni-tabbar ~ .uni-placeholder {
  34. width: 100%;
  35. margin-bottom: 0;
  36. margin-bottom: constant(safe-area-inset-bottom);
  37. margin-bottom: env(safe-area-inset-bottom);
  38. }
  39. .uni-tabbar * {
  40. box-sizing: border-box;
  41. }
  42. .uni-tabbar__item {
  43. display: flex;
  44. justify-content: center;
  45. align-items: center;
  46. flex-direction: column;
  47. flex: 1;
  48. font-size: 0;
  49. text-align: center;
  50. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  51. }
  52. .uni-tabbar__bd {
  53. position: relative;
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. justify-content: center;
  58. cursor: pointer;
  59. }
  60. .uni-tabbar__icon {
  61. position: relative;
  62. display: inline-block;
  63. margin-top: 5px;
  64. }
  65. .uni-tabbar__icon.uni-tabbar__icon__diff {
  66. margin-top: 0px;
  67. width: 34px;
  68. height: 34px;
  69. }
  70. .uni-tabbar__icon img {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. .uni-tabbar__iconfont {
  75. font-family: 'UniTabbarIconFont';
  76. }
  77. .uni-tabbar__label {
  78. position: relative;
  79. text-align: center;
  80. font-size: 10px;
  81. }
  82. .uni-tabbar-border {
  83. position: absolute;
  84. left: 0;
  85. top: 0;
  86. width: 100%;
  87. height: 1px;
  88. transform: scaleY(0.5);
  89. }
  90. .uni-tabbar__reddot {
  91. position: absolute;
  92. top: 2px;
  93. right: 0;
  94. width: 12px;
  95. height: 12px;
  96. border-radius: 50%;
  97. background-color: #f43530;
  98. color: #ffffff;
  99. transform: translate(40%, 0%);
  100. }
  101. .uni-tabbar__badge {
  102. width: auto;
  103. height: 16px;
  104. line-height: 16px;
  105. border-radius: 16px;
  106. min-width: 16px;
  107. padding: 0 2px;
  108. font-size: 12px;
  109. text-align: center;
  110. white-space: nowrap;
  111. }
  112. .uni-tabbar__mid {
  113. display: flex;
  114. justify-content: center;
  115. position: absolute;
  116. bottom: 0;
  117. background-size: 100% 100%;
  118. }
  119. .uni-app--showtabbar uni-page-wrapper {
  120. display: block;
  121. height: calc(100% - var(--tab-bar-height));
  122. height: calc(100% - var(--tab-bar-height) - constant(safe-area-inset-bottom));
  123. height: calc(100% - var(--tab-bar-height) - env(safe-area-inset-bottom));
  124. }
  125. .uni-app--showtabbar uni-page-wrapper::after {
  126. content: '';
  127. display: block;
  128. width: 100%;
  129. height: var(--tab-bar-height);
  130. height: calc(var(--tab-bar-height) + constant(safe-area-inset-bottom));
  131. height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom));
  132. }
  133. .uni-app--showtabbar
  134. uni-page-head[uni-page-head-type='default']
  135. ~ uni-page-wrapper {
  136. height: calc(100% - 44px - var(--tab-bar-height));
  137. height: calc(
  138. 100% - 44px - constant(safe-area-inset-top) - var(--tab-bar-height) -
  139. constant(safe-area-inset-bottom)
  140. );
  141. height: calc(
  142. 100% - 44px - env(safe-area-inset-top) - var(--tab-bar-height) -
  143. env(safe-area-inset-bottom)
  144. );
  145. }