lightpick.css 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. .lightpick {
  2. position: absolute;
  3. z-index: 99999;
  4. padding: 4px;
  5. border-radius: 4px;
  6. background-color: #FFF;
  7. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  8. color: #000;
  9. font-family: system-ui, Roboto, Helvetica, Arial, sans-serif;
  10. line-height: 1.125em;
  11. }
  12. .lightpick--inlined {
  13. position: relative;
  14. display: inline-block;
  15. }
  16. .lightpick,
  17. .lightpick *,
  18. .lightpick::after,
  19. .lightpick::before {
  20. box-sizing: border-box;
  21. }
  22. .lightpick.is-hidden {
  23. display: none;
  24. }
  25. .lightpick__months {
  26. display: grid;
  27. background-color: #EEE;
  28. grid-template-columns: auto;
  29. grid-gap: 1px;
  30. }
  31. .lightpick--2-columns .lightpick__months {
  32. grid-template-columns: auto auto;
  33. }
  34. .lightpick--3-columns .lightpick__months {
  35. grid-template-columns: auto auto auto;
  36. }
  37. .lightpick--4-columns .lightpick__months {
  38. grid-template-columns: auto auto auto auto;
  39. }
  40. .lightpick--5-columns .lightpick__months {
  41. grid-template-columns: auto auto auto auto auto;
  42. }
  43. .lightpick__month {
  44. padding: 4px;
  45. width: 288px;
  46. background-color: #FFF;
  47. }
  48. .lightpick__month-title-bar {
  49. display: flex;
  50. margin-bottom: 4px;
  51. justify-content: space-between;
  52. align-items: center;
  53. }
  54. .lightpick__month-title {
  55. margin-top: 4px;
  56. margin-bottom: 4px;
  57. margin-left: 4px;
  58. font-size: 16px;
  59. font-weight: normal;
  60. line-height: 24px;
  61. cursor: default;
  62. padding: 0 4px;
  63. border-radius: 4px;
  64. }
  65. .lightpick__month-title > .lightpick__select {
  66. border: none;
  67. background-color: transparent;
  68. outline: none;
  69. -moz-appearance: none;
  70. -webkit-appearance: none;
  71. appearance: none;
  72. }
  73. .lightpick__month-title > .lightpick__select:disabled {
  74. color: #333;
  75. }
  76. .lightpick__month-title > .lightpick__select-months {
  77. font-weight: bold;
  78. font-size: 1em;
  79. margin-right: .5em;
  80. }
  81. .lightpick__toolbar {
  82. display: flex;
  83. text-align: right;
  84. justify-content: flex-end;
  85. }
  86. .lightpick__previous-action,
  87. .lightpick__next-action,
  88. .lightpick__close-action {
  89. display: flex;
  90. margin-left: 6px;
  91. width: 32px;
  92. height: 32px;
  93. outline: none;
  94. border: none;
  95. border-radius: 50%;
  96. background-color: #DDD;
  97. justify-content: center;
  98. align-items: center;
  99. }
  100. .lightpick__previous-action,
  101. .lightpick__next-action {
  102. font-size: 12px;
  103. }
  104. .lightpick__close-action {
  105. font-size: 18px;
  106. }
  107. .lightpick__previous-action:active,
  108. .lightpick__next-action:active,
  109. .lightpick__close-action:active {
  110. color: inherit;
  111. }
  112. .lightpick__days-of-the-week {
  113. display: grid;
  114. grid-template-columns: repeat(7, 1fr);
  115. }
  116. .lightpick__day-of-the-week {
  117. display: flex;
  118. font-size: 11px;
  119. font-weight: bold;
  120. justify-content: center;
  121. align-items: center;
  122. }
  123. .lightpick__days {
  124. display: grid;
  125. grid-template-columns: repeat(7, 1fr);
  126. }
  127. .lightpick__day {
  128. display: flex;
  129. height: 40px;
  130. background-position: center center;
  131. background-size: contain;
  132. background-repeat: no-repeat;
  133. font-size: 13px;
  134. justify-content: center;
  135. align-items: center;
  136. cursor: default;
  137. }
  138. .lightpick__day.is-today {
  139. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle fill='rgba(220, 50, 47, .5)' cx='16' cy='16' r='16'/%3E%3C/svg%3E");
  140. background-size: 18.8% auto;
  141. background-position: center bottom;
  142. color: #DC322F;
  143. }
  144. .lightpick__day:not(.is-disabled):hover {
  145. background-size: contain;
  146. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle fill='%23E0E0E0' cx='16' cy='16' r='16'/%3E%3C/svg%3E");
  147. }
  148. .lightpick__day.is-disabled {
  149. opacity: 0.38;
  150. pointer-events: none;
  151. }
  152. .lightpick__day.disabled-tooltip {
  153. pointer-events: auto;
  154. }
  155. .lightpick__day.is-disabled.is-forward-selected {
  156. opacity: 1;
  157. }
  158. .lightpick__day.is-disabled.is-forward-selected:not(.is-start-date) {
  159. background-color: rgba(38, 139, 210, 0.1);
  160. background-image: none;
  161. }
  162. .lightpick__day.is-previous-month,
  163. .lightpick__day.is-next-month {
  164. opacity: 0.38;
  165. }
  166. .lightpick__day.lightpick__day.is-in-range:not(.is-disabled) {
  167. opacity: 1;
  168. }
  169. .lightpick__day.is-in-range {
  170. border-radius: 0;
  171. background-color: rgba(38, 139, 210, 0.1);
  172. background-image: none;
  173. }
  174. .lightpick__day.is-in-range:hover {
  175. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle fill='rgba(38, 139, 210, 0.5)' cx='16' cy='16' r='16'/%3E%3C/svg%3E");
  176. }
  177. .lightpick__day.is-start-date.is-in-range,
  178. .lightpick__day.is-end-date.is-in-range.is-flipped {
  179. border-top-left-radius: 50%;
  180. border-top-right-radius: 0;
  181. border-bottom-right-radius: 0;
  182. border-bottom-left-radius: 50%;
  183. background-color: #268BD2;
  184. background-image: none;
  185. }
  186. .lightpick__day.is-end-date.is-in-range,
  187. .lightpick__day.is-start-date.is-in-range.is-flipped {
  188. border-top-left-radius: 0;
  189. border-top-right-radius: 50%;
  190. border-bottom-right-radius: 50%;
  191. border-bottom-left-radius: 0;
  192. background-color: #268BD2;
  193. background-image: none;
  194. }
  195. .lightpick__day.is-start-date.is-end-date {
  196. background-color: transparent;
  197. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle fill='%23268BD2' cx='16' cy='16' r='16'/%3E%3C/svg%3E");
  198. }
  199. .lightpick__day.is-start-date,
  200. .lightpick__day.is-end-date,
  201. .lightpick__day.is-start-date:hover,
  202. .lightpick__day.is-end-date:hover {
  203. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle fill='%23268BD2' cx='16' cy='16' r='16'/%3E%3C/svg%3E");
  204. background-size: auto;
  205. background-position: center;
  206. color: #FFF;
  207. font-weight: bold;
  208. }
  209. .lightpick__tooltip {
  210. position: absolute;
  211. margin-top: -4px;
  212. padding: 4px 8px;
  213. border-radius: 4px;
  214. background-color: #FFF;
  215. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  216. white-space: nowrap;
  217. font-size: 11px;
  218. pointer-events: none;
  219. }
  220. .lightpick__tooltip::before {
  221. position: absolute;
  222. bottom: -5px;
  223. left: calc(50% - 5px);
  224. border-top: 5px solid rgba(0, 0, 0, 0.12);
  225. border-right: 5px solid transparent;
  226. border-left: 5px solid transparent;
  227. content: "";
  228. }
  229. .lightpick__tooltip::after {
  230. position: absolute;
  231. bottom: -4px;
  232. left: calc(50% - 4px);
  233. border-top: 4px solid #FFF;
  234. border-right: 4px solid transparent;
  235. border-left: 4px solid transparent;
  236. content: "";
  237. }
  238. .lightpick__footer {
  239. display: flex;
  240. justify-content: space-between;
  241. }
  242. .lightpick__reset-action,
  243. .lightpick__apply-action {
  244. border-radius: 5px;
  245. font-size: 12px;
  246. border: none;
  247. }
  248. .lightpick__reset-action {
  249. color: #fff;
  250. background-color: #aeacad;
  251. }
  252. .lightpick__apply-action {
  253. color: #fff;
  254. background-color: #2495f3;
  255. }