index.less 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @calendar-prefix-cls: ~'@{ant-prefix}-picker-calendar';
  4. @calendar-picker-prefix-cls: ~'@{ant-prefix}-picker';
  5. .@{calendar-prefix-cls} {
  6. .reset-component();
  7. background: @calendar-full-bg;
  8. // ========================= Header =========================
  9. &-header {
  10. display: flex;
  11. justify-content: flex-end;
  12. padding: @padding-sm 0;
  13. .@{calendar-prefix-cls}-year-select {
  14. min-width: 80px;
  15. }
  16. .@{calendar-prefix-cls}-month-select {
  17. min-width: 70px;
  18. margin-left: @padding-xs;
  19. }
  20. .@{calendar-prefix-cls}-mode-switch {
  21. margin-left: @padding-xs;
  22. }
  23. }
  24. .@{calendar-picker-prefix-cls}-panel {
  25. background: @calendar-full-panel-bg;
  26. border: 0;
  27. border-top: @border-width-base @border-style-base @border-color-split;
  28. border-radius: 0;
  29. .@{calendar-picker-prefix-cls}-month-panel,
  30. .@{calendar-picker-prefix-cls}-date-panel {
  31. width: auto;
  32. }
  33. .@{calendar-picker-prefix-cls}-body {
  34. padding: @padding-xs 0;
  35. }
  36. .@{calendar-picker-prefix-cls}-content {
  37. width: 100%;
  38. }
  39. }
  40. // ========================== Mini ==========================
  41. &-mini {
  42. border-radius: @border-radius-base;
  43. .@{calendar-picker-prefix-cls}-calendar-header {
  44. padding-right: @padding-xs;
  45. padding-left: @padding-xs;
  46. }
  47. .@{calendar-picker-prefix-cls}-panel {
  48. border-radius: 0 0 @border-radius-base @border-radius-base;
  49. }
  50. .@{calendar-picker-prefix-cls}-content {
  51. height: 256px;
  52. th {
  53. height: auto;
  54. padding: 0;
  55. line-height: 18px;
  56. }
  57. }
  58. .@{calendar-picker-prefix-cls}-cell::before {
  59. pointer-events: none;
  60. }
  61. }
  62. // ========================== Full ==========================
  63. &-full {
  64. .@{calendar-picker-prefix-cls}-panel {
  65. display: block;
  66. width: 100%;
  67. text-align: right;
  68. background: @calendar-full-bg;
  69. border: 0;
  70. .@{calendar-picker-prefix-cls}-body {
  71. th,
  72. td {
  73. padding: 0;
  74. }
  75. th {
  76. height: auto;
  77. padding: 0 12px 5px 0;
  78. line-height: 18px;
  79. }
  80. }
  81. // Cell
  82. .@{calendar-picker-prefix-cls}-cell {
  83. &::before {
  84. display: none;
  85. }
  86. &:hover {
  87. .@{calendar-prefix-cls}-date {
  88. background: @item-hover-bg;
  89. }
  90. }
  91. .@{calendar-prefix-cls}-date-today::before {
  92. display: none;
  93. }
  94. &-selected,
  95. &-selected:hover {
  96. .@{calendar-prefix-cls}-date,
  97. .@{calendar-prefix-cls}-date-today {
  98. background: @calendar-item-active-bg;
  99. .@{calendar-prefix-cls}-date-value {
  100. color: @primary-color;
  101. }
  102. }
  103. }
  104. }
  105. // Cell date
  106. .@{calendar-prefix-cls}-date {
  107. display: block;
  108. width: auto;
  109. height: auto;
  110. margin: 0 (@padding-xs / 2);
  111. padding: (@padding-xs / 2) @padding-xs 0;
  112. border: 0;
  113. border-top: 2px solid @border-color-split;
  114. border-radius: 0;
  115. transition: background 0.3s;
  116. &-value {
  117. line-height: 24px;
  118. transition: color 0.3s;
  119. }
  120. &-content {
  121. position: static;
  122. width: auto;
  123. height: 86px;
  124. overflow-y: auto;
  125. color: @text-color;
  126. line-height: @line-height-base;
  127. text-align: left;
  128. }
  129. &-today {
  130. border-color: @primary-color;
  131. .@{calendar-prefix-cls}-date-value {
  132. color: @text-color;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. @media only screen and (max-width: @screen-xs) {
  140. .@{calendar-prefix-cls} {
  141. &-header {
  142. display: block;
  143. .@{calendar-prefix-cls}-year-select {
  144. width: 50%;
  145. }
  146. .@{calendar-prefix-cls}-month-select {
  147. width: ~'calc(50% - @{padding-xs})';
  148. }
  149. .@{calendar-prefix-cls}-mode-switch {
  150. width: 100%;
  151. margin-top: @padding-xs;
  152. margin-left: 0;
  153. > label {
  154. width: 50%;
  155. text-align: center;
  156. }
  157. }
  158. }
  159. }
  160. }
  161. @import './rtl';