date-table.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. @use '../common/var' as *;
  2. @use '../mixins/mixins' as *;
  3. @include b(date-table) {
  4. font-size: 12px;
  5. user-select: none;
  6. @include when(week-mode) {
  7. .#{$namespace}-date-table__row {
  8. &:hover {
  9. .#{$namespace}-date-table-cell {
  10. background-color: getCssVar('datepicker-inrange-bg-color');
  11. }
  12. td.available:hover {
  13. color: getCssVar('datepicker-text-color');
  14. }
  15. td:first-child .#{$namespace}-date-table-cell {
  16. margin-left: 5px;
  17. border-top-left-radius: 15px;
  18. border-bottom-left-radius: 15px;
  19. }
  20. td:last-child .#{$namespace}-date-table-cell {
  21. margin-right: 5px;
  22. border-top-right-radius: 15px;
  23. border-bottom-right-radius: 15px;
  24. }
  25. }
  26. &.current .#{$namespace}-date-table-cell {
  27. background-color: getCssVar('datepicker-inrange-bg-color');
  28. }
  29. }
  30. }
  31. td {
  32. width: 32px;
  33. height: 30px;
  34. padding: 4px 0;
  35. box-sizing: border-box;
  36. text-align: center;
  37. cursor: pointer;
  38. position: relative;
  39. @include b(date-table-cell) {
  40. height: 30px;
  41. padding: 3px 0;
  42. box-sizing: border-box;
  43. @include b(date-table-cell__text) {
  44. width: 24px;
  45. height: 24px;
  46. display: block;
  47. margin: 0 auto;
  48. line-height: 24px;
  49. position: absolute;
  50. left: 50%;
  51. transform: translateX(-50%);
  52. border-radius: 50%;
  53. }
  54. }
  55. &.next-month,
  56. &.prev-month {
  57. color: getCssVar('datepicker-off-text-color');
  58. }
  59. &.today {
  60. position: relative;
  61. .#{$namespace}-date-table-cell__text {
  62. color: getCssVar('color-primary');
  63. font-weight: bold;
  64. }
  65. &.start-date .#{$namespace}-date-table-cell__text,
  66. &.end-date .#{$namespace}-date-table-cell__text {
  67. color: $color-white;
  68. }
  69. }
  70. &.available:hover {
  71. color: getCssVar('datepicker-hover-text-color');
  72. }
  73. &.in-range .#{$namespace}-date-table-cell {
  74. background-color: getCssVar('datepicker-inrange-bg-color');
  75. &:hover {
  76. background-color: getCssVar('datepicker-inrange-hover-bg-color');
  77. }
  78. }
  79. &.current:not(.disabled) {
  80. .#{$namespace}-date-table-cell__text {
  81. color: $color-white;
  82. background-color: getCssVar('datepicker-active-color');
  83. }
  84. &:focus-visible {
  85. .#{$namespace}-date-table-cell__text {
  86. outline: 2px solid getCssVar('datepicker-active-color');
  87. outline-offset: 1px;
  88. }
  89. }
  90. }
  91. &.start-date .#{$namespace}-date-table-cell,
  92. &.end-date .#{$namespace}-date-table-cell {
  93. color: $color-white;
  94. }
  95. &.start-date .#{$namespace}-date-table-cell__text,
  96. &.end-date .#{$namespace}-date-table-cell__text {
  97. background-color: getCssVar('datepicker-active-color');
  98. }
  99. &.start-date .#{$namespace}-date-table-cell {
  100. margin-left: 5px;
  101. border-top-left-radius: 15px;
  102. border-bottom-left-radius: 15px;
  103. }
  104. &.end-date .#{$namespace}-date-table-cell {
  105. margin-right: 5px;
  106. border-top-right-radius: 15px;
  107. border-bottom-right-radius: 15px;
  108. }
  109. &.disabled .#{$namespace}-date-table-cell {
  110. background-color: getCssVar('fill-color', 'light');
  111. opacity: 1;
  112. cursor: not-allowed;
  113. color: getCssVar('text-color', 'placeholder');
  114. }
  115. &.selected .#{$namespace}-date-table-cell {
  116. margin-left: 5px;
  117. margin-right: 5px;
  118. border-radius: 15px;
  119. }
  120. &.selected .#{$namespace}-date-table-cell__text {
  121. background-color: getCssVar('datepicker-active-color');
  122. color: $color-white;
  123. border-radius: 15px;
  124. }
  125. &.week {
  126. font-size: 80%;
  127. color: getCssVar('datepicker-header-text-color');
  128. }
  129. &:focus {
  130. outline: none;
  131. }
  132. }
  133. th {
  134. padding: 5px;
  135. color: getCssVar('datepicker-header-text-color');
  136. font-weight: 400;
  137. border-bottom: solid 1px getCssVar('border-color-lighter');
  138. }
  139. }