form-flat-pickr.scss 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. @import '../../../bootstrap-extended/include'; // Bootstrap includes
  2. @import '../../../components/include'; // Components includes
  3. .flatpickr-calendar {
  4. .flatpickr-day {
  5. color: $body-color;
  6. &.today {
  7. border-color: $primary;
  8. &:hover {
  9. background: transparent;
  10. color: $body-color;
  11. }
  12. }
  13. &.selected,
  14. &.selected:hover {
  15. background: $primary;
  16. color: $white;
  17. border-color: $primary;
  18. }
  19. &.inRange,
  20. &.inRange:hover {
  21. background: lighten($color: $primary, $amount: 30%);
  22. border-color: lighten($color: $primary, $amount: 30%);
  23. box-shadow: -5px 0 0 lighten($color: $primary, $amount: 30%), 5px 0 0 lighten($color: $primary, $amount: 30%);
  24. }
  25. &.startRange,
  26. &.endRange,
  27. &.startRange:hover,
  28. &.endRange:hover {
  29. background: $primary;
  30. color: $white;
  31. border-color: $primary;
  32. }
  33. &.selected.startRange + .endRange:not(:nth-child(7n + 1)),
  34. &.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
  35. &.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
  36. box-shadow: -10px 0 0 $primary;
  37. }
  38. &.flatpickr-disabled,
  39. &.prevMonthDay,
  40. &.nextMonthDay {
  41. color: $gray-300;
  42. }
  43. &:hover {
  44. background: $gray-50;
  45. }
  46. }
  47. &:after,
  48. &:before {
  49. display: none;
  50. }
  51. .flatpickr-months {
  52. .flatpickr-prev-month,
  53. .flatpickr-next-month {
  54. top: -5px;
  55. &:hover i,
  56. &:hover svg {
  57. fill: $primary;
  58. }
  59. }
  60. }
  61. .flatpickr-current-month span.cur-month {
  62. font-weight: 300;
  63. }
  64. &.open {
  65. z-index: 1051;
  66. }
  67. &.hasTime.open{
  68. .flatpickr-time{
  69. height: auto;
  70. }
  71. }
  72. }
  73. // Time picker hover & focus bg color
  74. .flatpickr-time input:hover,
  75. .flatpickr-time .flatpickr-am-pm:hover,
  76. .flatpickr-time input:focus,
  77. .flatpickr-time .flatpickr-am-pm:focus {
  78. background: $white;
  79. }
  80. //Dark layout
  81. .dark-layout {
  82. .flatpickr-calendar {
  83. background: $theme-dark-body-bg;
  84. border-color: $theme-dark-body-bg;
  85. box-shadow: none;
  86. .flatpickr-months {
  87. i,
  88. svg {
  89. fill: $theme-dark-body-color;
  90. }
  91. }
  92. .flatpickr-month {
  93. color: $theme-dark-body-color;
  94. }
  95. .flatpickr-weekwrapper .flatpickr-weeks {
  96. box-shadow: 1px 0 0 $theme-dark-border-color;
  97. }
  98. .flatpickr-weekday {
  99. color: $theme-dark-body-color;
  100. }
  101. .flatpickr-day {
  102. &,
  103. &.today:hover {
  104. color: $theme-dark-body-color;
  105. }
  106. &.selected {
  107. color: $white;
  108. }
  109. &.prevMonthDay,
  110. &.nextMonthDay,
  111. &.flatpickr-disabled {
  112. color: $gray-700 !important;
  113. }
  114. &.inRange,
  115. &.inRange:hover {
  116. background: $theme-dark-card-bg;
  117. border-color: $theme-dark-card-bg;
  118. box-shadow: -5px 0 0 $theme-dark-card-bg, 5px 0 0 $theme-dark-card-bg;
  119. }
  120. &:hover:not(.selected):not(.today):not(.startRange):not(.endRange) {
  121. color: $theme-dark-body-color;
  122. border-color: $theme-dark-card-bg;
  123. }
  124. }
  125. .flatpickr-days .flatpickr-day {
  126. &:hover:not(.selected):not(.today):not(.startRange):not(.endRange),
  127. &:focus:not(.selected):not(.today):not(.startRange):not(.endRange) {
  128. background: $theme-dark-card-bg;
  129. }
  130. }
  131. .flatpickr-time {
  132. border-color: $theme-dark-body-bg !important;
  133. .numInput,
  134. .flatpickr-am-pm {
  135. color: $theme-dark-body-color;
  136. &:hover {
  137. background: $theme-dark-body-bg;
  138. }
  139. }
  140. .arrowUp:after {
  141. border-bottom-color: $theme-dark-body-color;
  142. }
  143. .arrowDown:after {
  144. border-top-color: $theme-dark-body-color;
  145. }
  146. }
  147. }
  148. // Time picker hover & focus bg color
  149. .flatpickr-time input:hover,
  150. .flatpickr-time .flatpickr-am-pm:hover,
  151. .flatpickr-time input:focus,
  152. .flatpickr-time .flatpickr-am-pm:focus {
  153. background: $theme-dark-body-bg;
  154. }
  155. }
  156. // ? Added bg color for flatpickr input only as it has default readonly attribute
  157. .flatpickr-input[readonly],
  158. .flatpickr-input ~ .form-control[readonly],
  159. .flatpickr-human-friendly[readonly] {
  160. background-color: inherit;
  161. opacity: 1 !important;
  162. }
  163. .flatpickr-weekdays {
  164. margin-top: 8px;
  165. }
  166. .flatpickr-current-month {
  167. .flatpickr-monthDropdown-months {
  168. -webkit-appearance: none;
  169. }
  170. .flatpickr-monthDropdown-months,
  171. .numInputWrapper {
  172. font-size: 1.1rem;
  173. border-radius: 4px;
  174. padding: 2px;
  175. transition: all 0.15s ease-out;
  176. span {
  177. display: none;
  178. }
  179. }
  180. }