calendar.scss 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. @include b(calendar) {
  5. @include set-component-css-var('calendar', $calendar);
  6. background-color: getCssVar('fill-color', 'blank');
  7. @include e(header) {
  8. display: flex;
  9. justify-content: space-between;
  10. padding: 12px 20px;
  11. border-bottom: getCssVar('calendar', 'header-border-bottom');
  12. }
  13. @include e(title) {
  14. color: getCssVar('text-color');
  15. align-self: center;
  16. }
  17. @include e(body) {
  18. padding: 12px 20px 35px;
  19. }
  20. @include e(select-controller) {
  21. .#{$namespace}-select {
  22. margin-right: 8px;
  23. }
  24. .#{$namespace}-calendar-select__year {
  25. width: 120px;
  26. }
  27. .#{$namespace}-calendar-select__month {
  28. width: 60px;
  29. }
  30. }
  31. }
  32. @include b(calendar-table) {
  33. table-layout: fixed;
  34. width: 100%;
  35. thead th {
  36. padding: 12px 0;
  37. color: getCssVar('text-color', 'regular');
  38. font-weight: normal;
  39. }
  40. &:not(.is-range) {
  41. td.prev,
  42. td.next {
  43. color: getCssVar('text-color', 'placeholder');
  44. }
  45. }
  46. td {
  47. border-bottom: getCssVar('calendar', 'border');
  48. border-right: getCssVar('calendar', 'border');
  49. vertical-align: top;
  50. transition: background-color getCssVar('transition-duration', 'fast') ease;
  51. @include when(selected) {
  52. background-color: getCssVar('calendar', 'selected-bg-color');
  53. }
  54. @include when(today) {
  55. color: getCssVar('color-primary');
  56. }
  57. }
  58. tr:first-child td {
  59. border-top: getCssVar('calendar', 'border');
  60. }
  61. tr td:first-child {
  62. border-left: getCssVar('calendar', 'border');
  63. }
  64. tr.#{$namespace}-calendar-table__row--hide-border td {
  65. border-top: none;
  66. }
  67. @include b(calendar-day) {
  68. box-sizing: border-box;
  69. padding: 8px;
  70. height: getCssVar('calendar', 'cell-width');
  71. &:hover {
  72. cursor: pointer;
  73. background-color: getCssVar('calendar', 'selected-bg-color');
  74. }
  75. }
  76. }