index.less 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .@{wux-prefix}-calendar {
  4. position: relative;
  5. background: @calendar-bg;
  6. height: @calendar-height;
  7. width: 100%;
  8. overflow: hidden;
  9. &__content {
  10. position: relative;
  11. width: 100%;
  12. height: 100%;
  13. transition: transform .3s;
  14. }
  15. &__bd {
  16. height: 100%;
  17. position: relative;
  18. overflow: hidden;
  19. }
  20. &__hd {
  21. position: relative;
  22. width: 100%;
  23. &::before {
  24. .setTopLine(@border-color-split);
  25. }
  26. }
  27. &__hd + &__bd {
  28. height: calc(100% - 2.2rem);
  29. }
  30. &__toolbar {
  31. height: 2.2rem;
  32. display: flex;
  33. text-align: center;
  34. }
  35. &__picker {
  36. display: flex;
  37. align-items: center;
  38. justify-content: space-between;
  39. width: 50%;
  40. max-width: 200px;
  41. flex-shrink: 10;
  42. display: block;
  43. line-height: 2.2rem;
  44. }
  45. &__link {
  46. float: left;
  47. width: 25%;
  48. height: 2.2rem;
  49. line-height: 2rem;
  50. min-width: 36px;
  51. }
  52. &__icon {
  53. display: inline-block;
  54. vertical-align: middle;
  55. background-size: 100% auto;
  56. background-position: center;
  57. &--next,
  58. &--prev {
  59. width: 0.75rem;
  60. height: 0.75rem;
  61. }
  62. &--next {
  63. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%23007aff'%20d%3D'M1%2C1.6l11.8%2C5.8L1%2C13.4V1.6%20M0%2C0v15l15-7.6L0%2C0L0%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  64. }
  65. &--prev {
  66. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%23007aff'%20d%3D'M14%2C1.6v11.8L2.2%2C7.6L14%2C1.6%20M15%2C0L0%2C7.6L15%2C15V0L15%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  67. }
  68. }
  69. &__value {
  70. flex-shrink: 1;
  71. position: relative;
  72. overflow: hidden;
  73. text-overflow: ellipsis;
  74. float: left;
  75. width: 50%;
  76. height: 2.2rem;
  77. }
  78. &__weekdays {
  79. height: 18px;
  80. background: #f7f7f8;
  81. display: flex;
  82. font-size: 11px;
  83. box-sizing: border-box;
  84. position: relative;
  85. &::after {
  86. .setBottomLine(@border-color-split);
  87. }
  88. }
  89. &__weekdays + &__months {
  90. height: calc(100% - 18px);
  91. }
  92. &__weekday {
  93. flex-shrink: 1;
  94. width: 14.28571429%;
  95. width: calc(100% / 7);
  96. line-height: 17px;
  97. text-align: center;
  98. }
  99. &__months {
  100. width: 100%;
  101. height: 100%;
  102. overflow: hidden;
  103. position: relative;
  104. &-content {
  105. position: relative;
  106. width: 100%;
  107. height: 100%;
  108. display: flex;
  109. position: relative;
  110. -webkit-backface-visibility: hidden;
  111. transform: translate3d(0, 0, 0);
  112. }
  113. }
  114. &__month {
  115. display: flex;
  116. flex-direction: column;
  117. width: 100%;
  118. height: 100%;
  119. position: absolute;
  120. left: 0;
  121. top: 0;
  122. }
  123. &__days {
  124. height: 16.66666667%;
  125. height: calc(100% / 6);
  126. display: flex;
  127. flex-shrink: 1;
  128. width: 100%;
  129. position: relative;
  130. &::after {
  131. .setBottomLine(@border-color-split);
  132. }
  133. &:last-child::after {
  134. display: none;
  135. }
  136. }
  137. &__day {
  138. flex-shrink: 1;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. box-sizing: border-box;
  143. width: 14.28571429%;
  144. width: calc(100% / 7);
  145. text-align: center;
  146. color: @calendar-text-color;
  147. font-size: @calendar-text-font-size;
  148. cursor: pointer;
  149. &--prev {
  150. color: @calendar-prev-text-color;
  151. }
  152. &--next {
  153. color: @calendar-next-text-color;
  154. }
  155. &--disabled {
  156. color: @calendar-disabled-text-color;
  157. cursor: auto;
  158. }
  159. }
  160. &__day--today &__text {
  161. background: @calendar-today-text-color;
  162. }
  163. &__day--selected &__text {
  164. background: @calendar-active-text-bg;
  165. color: @calendar-active-text-color;
  166. }
  167. &__text {
  168. display: inline-block;
  169. border-radius: 100%;
  170. width: @calendar-text-size;
  171. height: @calendar-text-size;
  172. line-height: @calendar-text-size;
  173. }
  174. }