calendar.scss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. @use '../helpers/baseMixin.scss';
  2. .vxe-calendar {
  3. display: inline-flex;
  4. flex-direction: column;
  5. width: 100%;
  6. height: 38em;
  7. border: 1px solid var(--vxe-ui-base-popup-border-color);
  8. border-radius: var(--vxe-ui-base-border-radius);
  9. &.type--date {
  10. .vxe-calendar--body {
  11. td {
  12. width: 14.28571%;
  13. }
  14. }
  15. }
  16. &.type--week {
  17. .vxe-calendar--body {
  18. td {
  19. width: 12%;
  20. &:first-child {
  21. width: 14%;
  22. }
  23. }
  24. }
  25. }
  26. &.type--quarter {
  27. .vxe-calendar--body {
  28. td {
  29. width: 50%;
  30. }
  31. }
  32. }
  33. &.type--month,
  34. &.type--year {
  35. .vxe-calendar--body {
  36. td {
  37. width: 25%;
  38. }
  39. }
  40. }
  41. }
  42. .vxe-calendar--confirm {
  43. outline: 0;
  44. border: 1px solid var(--vxe-ui-input-border-color);
  45. border-radius: var(--vxe-ui-base-border-radius);
  46. cursor: pointer;
  47. color: var(--vxe-ui-input-date-time-confirm-button-color);
  48. border-color: var(--vxe-ui-font-primary-color);
  49. background-color: var(--vxe-ui-font-primary-color);
  50. padding: 0 0.5em;
  51. &:hover {
  52. background-color: var(--vxe-ui-font-primary-lighten-color);
  53. border-color: var(--vxe-ui-font-primary-lighten-color);
  54. }
  55. &:active {
  56. background-color: var(--vxe-ui-font-primary-darken-color);
  57. border-color: var(--vxe-ui-font-primary-darken-color);
  58. }
  59. }
  60. .vxe-calendar--header {
  61. flex-shrink: 0;
  62. display: flex;
  63. flex-direction: row;
  64. padding: var(--vxe-ui-layout-padding-default);
  65. user-select: none;
  66. border-bottom: 1px solid var(--vxe-ui-input-border-color);
  67. .vxe-calendar--type-wrapper {
  68. flex-grow: 1;
  69. }
  70. .vxe-calendar--btn-wrapper {
  71. flex-shrink: 0;
  72. text-align: center;
  73. }
  74. }
  75. .vxe-calendar--btn-wrapper {
  76. display: flex;
  77. flex-direction: row;
  78. }
  79. .vxe-calendar--btn {
  80. &.is--disabled {
  81. color: var(--vxe-ui-font-disabled-color);
  82. cursor: no-drop;
  83. }
  84. &:not(.is--disabled) {
  85. cursor: pointer;
  86. &:hover {
  87. background-color: #fff;
  88. }
  89. &:active {
  90. background-color: #fff;
  91. }
  92. }
  93. }
  94. .vxe-calendar--body {
  95. position: relative;
  96. flex-grow: 1;
  97. overflow: hidden;
  98. table {
  99. border: 0;
  100. width: 100%;
  101. height: 100%;
  102. border-spacing: 0;
  103. border-collapse: separate;
  104. text-align: center;
  105. table-layout: fixed
  106. }
  107. }
  108. .vxe-calendar--view-th {
  109. font-weight: 700;
  110. }
  111. .vxe-calendar--view-td {
  112. font-weight: normal;
  113. user-select: none;
  114. @include baseMixin.createAnimationTransition(all, 0.1s);
  115. &.is--prev,
  116. &.is--next {
  117. color: var(--vxe-ui-font-disabled-color);
  118. .vxe-calendar--date-label,
  119. .vxe-calendar--date-festival {
  120. color: var(--vxe-ui-font-disabled-color);
  121. }
  122. }
  123. &.is--now {
  124. &:not(.is--selected) {
  125. &.is--current {
  126. color: var(--vxe-ui-font-primary-color);
  127. .vxe-calendar--date-label,
  128. .vxe-calendar--date-festival {
  129. color: var(--vxe-ui-font-primary-color);
  130. }
  131. }
  132. }
  133. }
  134. &.is--hover {
  135. background-color: var(--vxe-ui-base-hover-background-color);
  136. }
  137. &.is--selected {
  138. color: var(--vxe-ui-calendar-selected-color);
  139. background-color: var(--vxe-ui-font-primary-color);
  140. &.is--prev,
  141. &.is--next {
  142. background-color: var(--vxe-ui-font-primary-lighten-color);
  143. }
  144. .vxe-calendar--date-label,
  145. .vxe-calendar--date-festival {
  146. color: var(--vxe-ui-calendar-festival-selected-color);
  147. }
  148. .vxe-calendar--date-label {
  149. &.is-notice {
  150. &:before {
  151. background-color: var(--vxe-ui-calendar-notice-selected-background-color);
  152. }
  153. }
  154. }
  155. }
  156. &:not(.is--disabled) {
  157. cursor: pointer;
  158. }
  159. &.is--disabled {
  160. cursor: no-drop;
  161. color: var(--vxe-ui-input-disabled-color);
  162. background-color: var(--vxe-ui-input-disabled-background-color);
  163. .vxe-calendar--date-label,
  164. .vxe-calendar--date-festival {
  165. color: var(--vxe-ui-input-disabled-color);
  166. }
  167. }
  168. }
  169. .vxe-calendar--date-label,
  170. .vxe-calendar--date-festival {
  171. display: block;
  172. overflow: hidden;
  173. }
  174. .vxe-calendar--date-label {
  175. position: relative;
  176. &.is-notice {
  177. &:before {
  178. content: "";
  179. position: absolute;
  180. width: 4px;
  181. height: 4px;
  182. left: 0.8em;
  183. top: 0.1em;
  184. transform: translateX(-50%);
  185. border-radius: 100%;
  186. background-color: var(--vxe-ui-input-date-notice-background-color);
  187. }
  188. }
  189. }
  190. .vxe-calendar--date-label--extra {
  191. position: absolute;
  192. right: 0.1em;
  193. top: -0.2em;
  194. transform: scale(0.9);
  195. color: var(--vxe-ui-input-date-extra-color);
  196. &.is-important {
  197. color: var(--vxe-ui-input-date-extra-important-color);
  198. }
  199. }
  200. .vxe-calendar--date-festival {
  201. color: var(--vxe-ui-input-date-festival-color);
  202. height: 14px;
  203. line-height: 1;
  204. overflow: hidden;
  205. &.is-important {
  206. color: var(--vxe-ui-input-date-festival-important-color);
  207. }
  208. }
  209. .vxe-calendar--date-festival--label {
  210. display: block;
  211. transform: scale(0.8);
  212. }
  213. @keyframes festivalOverlap2 {
  214. 0%, 45%, 100% {
  215. transform: translateY(0);
  216. }
  217. 50%, 95% {
  218. transform: translateY(-14px);
  219. }
  220. }
  221. @keyframes festivalOverlap3 {
  222. 0%, 20%, 100% {
  223. transform: translateY(0);
  224. }
  225. 25%, 45%, 75%, 95% {
  226. transform: translateY(-14px);
  227. }
  228. 50%, 70% {
  229. transform: translateY(-28px);
  230. }
  231. }
  232. .vxe-calendar--date-festival--overlap {
  233. display: block;
  234. font-size: 12px;
  235. &.overlap--2 {
  236. animation: festivalOverlap2 6s infinite ease-in-out;
  237. }
  238. &.overlap--3 {
  239. animation: festivalOverlap3 9s infinite ease-in-out;
  240. }
  241. & > span {
  242. height: 14px;
  243. display: block;
  244. transform: scale(0.8);
  245. }
  246. }
  247. .vxe-calendar {
  248. font-size: var(--vxe-ui-font-size-default);
  249. &.size--medium {
  250. font-size: var(--vxe-ui-font-size-medium);
  251. }
  252. &.size--small {
  253. font-size: var(--vxe-ui-font-size-small);
  254. }
  255. &.size--mini {
  256. font-size: var(--vxe-ui-font-size-mini);
  257. }
  258. }