_calendars.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. // Calendars
  2. .calendar {
  3. border: $border-width solid $border-color;
  4. border-radius: $border-radius;
  5. display: block;
  6. min-width: 280px;
  7. .calendar-nav {
  8. align-items: center;
  9. background: $bg-color;
  10. border-top-left-radius: $border-radius;
  11. border-top-right-radius: $border-radius;
  12. display: flex;
  13. font-size: $font-size-lg;
  14. padding: $layout-spacing;
  15. }
  16. .calendar-header,
  17. .calendar-body {
  18. display: flex;
  19. flex-wrap: wrap;
  20. justify-content: center;
  21. padding: $layout-spacing 0;
  22. .calendar-date {
  23. flex: 0 0 14.28%; // 7 calendar-items each row
  24. max-width: 14.28%;
  25. }
  26. }
  27. .calendar-header {
  28. background: $bg-color;
  29. border-bottom: $border-width solid $border-color;
  30. color: $gray-color;
  31. font-size: $font-size-sm;
  32. text-align: center;
  33. }
  34. .calendar-body {
  35. color: $gray-color-dark;
  36. }
  37. .calendar-date {
  38. border: 0;
  39. padding: $unit-1;
  40. .date-item {
  41. @include control-transition();
  42. appearance: none;
  43. background: transparent;
  44. border: $border-width solid transparent;
  45. border-radius: 50%;
  46. color: $gray-color-dark;
  47. cursor: pointer;
  48. font-size: $font-size-sm;
  49. height: $unit-7;
  50. line-height: $unit-5;
  51. outline: none;
  52. padding: $unit-h;
  53. position: relative;
  54. text-align: center;
  55. text-decoration: none;
  56. vertical-align: middle;
  57. white-space: nowrap;
  58. width: $unit-7;
  59. &.date-today {
  60. border-color: $secondary-color-dark;
  61. color: $primary-color;
  62. }
  63. &:focus {
  64. @include control-shadow();
  65. }
  66. &:focus,
  67. &:hover {
  68. background: $secondary-color-light;
  69. border-color: $secondary-color-dark;
  70. color: $primary-color;
  71. text-decoration: none;
  72. }
  73. &:active,
  74. &.active {
  75. background: $primary-color-dark;
  76. border-color: darken($primary-color-dark, 5%);
  77. color: $light-color;
  78. }
  79. // Calendar badge support
  80. &.badge {
  81. &::after {
  82. position: absolute;
  83. top: 3px;
  84. right: 3px;
  85. transform: translate(50%, -50%);
  86. }
  87. }
  88. }
  89. &.disabled .date-item,
  90. &.disabled .calendar-event,
  91. .date-item:disabled,
  92. .calendar-event:disabled {
  93. cursor: default;
  94. opacity: .25;
  95. pointer-events: none;
  96. }
  97. }
  98. .calendar-range {
  99. position: relative;
  100. &::before {
  101. background: $secondary-color;
  102. content: "";
  103. height: $unit-7;
  104. left: 0;
  105. position: absolute;
  106. right: 0;
  107. top: 50%;
  108. transform: translateY(-50%);
  109. }
  110. &.range-start {
  111. &::before {
  112. left: 50%;
  113. }
  114. }
  115. &.range-end {
  116. &::before {
  117. right: 50%;
  118. }
  119. }
  120. .date-item {
  121. color: $primary-color;
  122. }
  123. }
  124. &.calendar-lg {
  125. .calendar-body {
  126. padding: 0;
  127. .calendar-date {
  128. border-bottom: $border-width solid $border-color;
  129. border-right: $border-width solid $border-color;
  130. display: flex;
  131. flex-direction: column;
  132. height: 5.5rem;
  133. padding: 0;
  134. &:nth-child(7n) {
  135. border-right: 0;
  136. }
  137. &:nth-last-child(-n+7) {
  138. border-bottom: 0;
  139. }
  140. }
  141. }
  142. .date-item {
  143. align-self: flex-end;
  144. height: $unit-7;
  145. margin-right: $layout-spacing-sm;
  146. margin-top: $layout-spacing-sm;
  147. }
  148. .calendar-range {
  149. &::before {
  150. top: 19px;
  151. }
  152. &.range-start {
  153. &::before {
  154. left: auto;
  155. width: 19px;
  156. }
  157. }
  158. &.range-end {
  159. &::before {
  160. right: 19px;
  161. }
  162. }
  163. }
  164. .calendar-events {
  165. flex-grow: 1;
  166. line-height: 1;
  167. overflow-y: auto;
  168. padding: $layout-spacing-sm;
  169. }
  170. .calendar-event {
  171. border-radius: $border-radius;
  172. font-size: $font-size-sm;
  173. display: block;
  174. margin: $unit-h auto;
  175. overflow: hidden;
  176. padding: 3px 4px;
  177. text-overflow: ellipsis;
  178. white-space: nowrap;
  179. }
  180. }
  181. }