date-picker-day.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. /* mixins & extensions */
  2. @keyframes in {
  3. 0% {
  4. opacity: 0;
  5. }
  6. 100% {
  7. opacity: 1;
  8. }
  9. }
  10. @keyframes in-down {
  11. 0% {
  12. opacity: 0;
  13. transform: translate3D(0, -5px, 0);
  14. }
  15. 100% {
  16. opacity: 1;
  17. transform: translate3D(0, 0, 0);
  18. }
  19. }
  20. @keyframes in-up {
  21. 0% {
  22. opacity: 0;
  23. transform: translate3D(0, 5px, 0);
  24. }
  25. 100% {
  26. opacity: 1;
  27. transform: translate3D(0, 0, 0);
  28. }
  29. }
  30. @keyframes in-scale {
  31. 0% {
  32. opacity: 0;
  33. transform: scale3D(0.95, 0.95, 1);
  34. }
  35. 100% {
  36. opacity: 1;
  37. transform: scale3D(1, 1, 1);
  38. }
  39. }
  40. :root {
  41. --calcite-animation-timing: calc(150ms * var(--calcite-internal-duration-factor));
  42. --calcite-internal-duration-factor: var(--calcite-duration-factor, 1);
  43. --calcite-internal-animation-timing-fast: calc(100ms * var(--calcite-internal-duration-factor));
  44. --calcite-internal-animation-timing-medium: calc(200ms * var(--calcite-internal-duration-factor));
  45. --calcite-internal-animation-timing-slow: calc(300ms * var(--calcite-internal-duration-factor));
  46. }
  47. .calcite-animate {
  48. opacity: 0;
  49. animation-fill-mode: both;
  50. animation-duration: var(--calcite-animation-timing);
  51. }
  52. .calcite-animate__in {
  53. animation-name: in;
  54. }
  55. .calcite-animate__in-down {
  56. animation-name: in-down;
  57. }
  58. .calcite-animate__in-up {
  59. animation-name: in-up;
  60. }
  61. .calcite-animate__in-scale {
  62. animation-name: in-scale;
  63. }
  64. /**
  65. * Currently only used in Checkbox.
  66. */
  67. :root {
  68. --calcite-popper-transition: var(--calcite-animation-timing);
  69. }
  70. :host([hidden]) {
  71. display: none;
  72. }
  73. :host {
  74. display: flex;
  75. min-width: 0px;
  76. cursor: pointer;
  77. justify-content: center;
  78. color: var(--calcite-ui-text-3);
  79. width: 14.2857142857%;
  80. }
  81. :host([disabled]) {
  82. pointer-events: none;
  83. cursor: default;
  84. -webkit-user-select: none;
  85. user-select: none;
  86. opacity: var(--calcite-ui-opacity-disabled);
  87. }
  88. :host([disabled]) ::slotted([calcite-hydrated][disabled]),
  89. :host([disabled]) [calcite-hydrated][disabled] {
  90. /* prevent opacity stacking */
  91. opacity: 1;
  92. }
  93. .day-v-wrapper {
  94. flex: 1 1 auto;
  95. }
  96. .day-wrapper {
  97. display: flex;
  98. flex-direction: column;
  99. align-items: center;
  100. }
  101. .day {
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. border-radius: 9999px;
  106. font-size: var(--calcite-font-size--2);
  107. line-height: 1rem;
  108. line-height: 1;
  109. color: var(--calcite-ui-text-3);
  110. opacity: var(--calcite-ui-opacity-disabled);
  111. transition-property: all;
  112. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  113. transition-duration: 150ms;
  114. background: none;
  115. box-shadow: 0 0 0 2px transparent, 0 0 0 0px transparent;
  116. }
  117. .text {
  118. margin-top: 1px;
  119. margin-right: 0px;
  120. margin-bottom: 0px;
  121. margin-left: 1px;
  122. }
  123. :host([scale=s]) .day-v-wrapper {
  124. padding-top: 0.125rem;
  125. padding-bottom: 0.125rem;
  126. }
  127. :host([scale=s]) .day-wrapper {
  128. padding: 0px;
  129. }
  130. :host([scale=s]) .day {
  131. height: 27px;
  132. width: 27px;
  133. font-size: var(--calcite-font-size--2);
  134. }
  135. :host([scale=m]) .day-v-wrapper {
  136. padding-top: 0.25rem;
  137. padding-bottom: 0.25rem;
  138. }
  139. :host([scale=m]) .day-wrapper {
  140. padding-left: 0.25rem;
  141. padding-right: 0.25rem;
  142. }
  143. :host([scale=m]) .day {
  144. height: 33px;
  145. width: 33px;
  146. font-size: var(--calcite-font-size--1);
  147. }
  148. :host([scale=l]) .day-v-wrapper {
  149. padding-top: 0.25rem;
  150. padding-bottom: 0.25rem;
  151. }
  152. :host([scale=l]) .day-wrapper {
  153. padding-left: 0.25rem;
  154. padding-right: 0.25rem;
  155. }
  156. :host([scale=l]) .day {
  157. height: 43px;
  158. width: 43px;
  159. font-size: var(--calcite-font-size-0);
  160. }
  161. :host([current-month]) .day {
  162. opacity: 1;
  163. }
  164. :host(:hover:not([disabled])) .day, :host([active]:not([range])) .day {
  165. background-color: var(--calcite-ui-foreground-2);
  166. color: var(--calcite-ui-text-1);
  167. }
  168. :host(:focus), :host([active]) {
  169. outline: 2px solid transparent;
  170. outline-offset: 2px;
  171. z-index: 1;
  172. }
  173. :host(:focus:not([disabled])) .day {
  174. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);
  175. }
  176. :host([selected]) .day {
  177. font-weight: var(--calcite-font-weight-medium);
  178. background-color: var(--calcite-ui-brand) !important;
  179. color: var(--calcite-ui-foreground-1) !important;
  180. z-index: 1;
  181. }
  182. :host([range][selected]) .day-wrapper {
  183. background-color: var(--calcite-ui-foreground-current);
  184. }
  185. :host([start-of-range]) .day-wrapper {
  186. border-start-start-radius: 40%;
  187. border-end-start-radius: 40%;
  188. }
  189. :host([end-of-range]) .day-wrapper {
  190. border-start-end-radius: 40%;
  191. border-end-end-radius: 40%;
  192. }
  193. :host([start-of-range]) :not(.calcite--rtl) .day-wrapper,
  194. :host([end-of-range]) .calcite--rtl .day-wrapper {
  195. box-shadow: inset 4px 0 var(--calcite-ui-foreground-1);
  196. }
  197. :host([start-of-range]) :not(.calcite--rtl) .day,
  198. :host([end-of-range]) .calcite--rtl .day {
  199. opacity: 1;
  200. }
  201. :host([start-of-range]:not(:focus)) :not(.calcite--rtl) .day,
  202. :host([end-of-range]:not(:focus)) .calcite--rtl .day {
  203. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  204. }
  205. :host([end-of-range]) :not(.calcite--rtl) .day-wrapper,
  206. :host([start-of-range]) .calcite--rtl .day-wrapper {
  207. box-shadow: inset -4px 0 var(--calcite-ui-foreground-1);
  208. }
  209. :host([end-of-range]) :not(.calcite--rtl) .day,
  210. :host([start-of-range]) .calcite--rtl .day {
  211. opacity: 1;
  212. }
  213. :host([end-of-range]:not(:focus)) :not(.calcite--rtl) .day,
  214. :host([start-of-range]:not(:focus)) .calcite--rtl .day {
  215. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  216. }
  217. :host([end-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper,
  218. :host([start-of-range][scale=l]) .calcite--rtl .day-wrapper {
  219. box-shadow: inset -8px 0 var(--calcite-ui-foreground-1);
  220. }
  221. :host([start-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper,
  222. :host([end-of-range][scale=l]) .calcite--rtl .day-wrapper {
  223. box-shadow: inset 8px 0 var(--calcite-ui-foreground-1);
  224. }
  225. :host([highlighted]) .day-wrapper {
  226. background-color: var(--calcite-ui-foreground-current);
  227. }
  228. :host([highlighted]) .day-wrapper .day {
  229. color: var(--calcite-ui-text-1);
  230. }
  231. :host([highlighted]:not([active]:focus)) .day {
  232. border-radius: 0px;
  233. color: var(--calcite-ui-text-1);
  234. }
  235. :host([range-hover]:not([selected])) .day-wrapper {
  236. background-color: var(--calcite-ui-foreground-2);
  237. }
  238. :host([range-hover]:not([selected])) .day {
  239. border-radius: 0px;
  240. }
  241. :host([end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,
  242. :host([start-of-range][range-hover]) .calcite--rtl .day-wrapper {
  243. background-image: linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));
  244. border-radius: 0px;
  245. --tw-shadow: 0 0 #0000;
  246. --tw-shadow-colored: 0 0 #0000;
  247. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  248. }
  249. :host([start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,
  250. :host([end-of-range][range-hover]) .calcite--rtl .day-wrapper {
  251. background-image: linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));
  252. border-radius: 0px;
  253. --tw-shadow: 0 0 #0000;
  254. --tw-shadow-colored: 0 0 #0000;
  255. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  256. }
  257. :host(:hover[end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,
  258. :host(:hover[start-of-range][range-hover]) .calcite--rtl .day-wrapper {
  259. background-image: linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));
  260. border-radius: 0px;
  261. --tw-shadow: 0 0 #0000;
  262. --tw-shadow-colored: 0 0 #0000;
  263. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  264. }
  265. :host(:hover[start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,
  266. :host(:hover[end-of-range][range-hover]) .calcite--rtl .day-wrapper {
  267. background-image: linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));
  268. border-radius: 0px;
  269. --tw-shadow: 0 0 #0000;
  270. --tw-shadow-colored: 0 0 #0000;
  271. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  272. }
  273. :host(:hover[range-hover]:not([selected]).focused--end) :not(.calcite--rtl) .day-wrapper,
  274. :host(:hover[range-hover]:not([selected]).focused--start) .calcite--rtl .day-wrapper {
  275. background-image: linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current));
  276. }
  277. :host(:hover[range-hover]:not([selected]).focused--end) :not(.calcite--rtl) .day, :host(:hover[range-hover]:not([selected]).focused--start) .calcite--rtl .day {
  278. border-radius: 9999px;
  279. opacity: 1;
  280. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  281. }
  282. :host(:hover[range-hover]:not([selected]).focused--start) :not(.calcite--rtl) .day-wrapper,
  283. :host(:hover[range-hover]:not([selected]).focused--end) .calcite--rtl .day-wrapper {
  284. background-image: linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));
  285. }
  286. :host(:hover[range-hover]:not([selected]).focused--start) :not(.calcite--rtl) .day, :host(:hover[range-hover]:not([selected]).focused--end) .calcite--rtl .day {
  287. border-radius: 9999px;
  288. opacity: 1;
  289. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  290. }
  291. :host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day-wrapper,
  292. :host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day-wrapper {
  293. background-image: linear-gradient(to right, var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));
  294. }
  295. :host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day, :host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day {
  296. border-radius: 9999px;
  297. opacity: 1;
  298. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  299. }
  300. :host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day-wrapper,
  301. :host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day-wrapper {
  302. background-image: linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));
  303. }
  304. :host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day, :host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day {
  305. border-radius: 9999px;
  306. opacity: 1;
  307. box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
  308. }
  309. :host(:hover[start-of-range].hover--inside-range.focused--end) .day-wrapper, :host(:hover[end-of-range].hover--inside-range.focused--start) .day-wrapper {
  310. background-image: none;
  311. }
  312. :host([start-of-range].hover--inside-range.focused--end) .day-wrapper, :host([end-of-range].hover--inside-range.focused--start) .day-wrapper {
  313. background-color: var(--calcite-ui-foreground-2);
  314. }
  315. :host([highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,
  316. :host([range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,
  317. :host([highlighted]:first-child) .calcite--rtl .day-wrapper,
  318. :host([range-hover]:first-child) .calcite--rtl .day-wrapper {
  319. box-shadow: inset -4px 0px 0px 0px var(--calcite-ui-foreground-1);
  320. }
  321. :host([highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,
  322. :host([range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,
  323. :host([highlighted]:last-child) .calcite--rtl .day-wrapper,
  324. :host([range-hover]:last-child) .calcite--rtl .day-wrapper {
  325. box-shadow: inset 4px 0px 0px 0px var(--calcite-ui-foreground-1);
  326. }
  327. :host([scale=s][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,
  328. :host([scale=s][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,
  329. :host([scale=s][highlighted]:first-child) .calcite--rtl .day-wrapper,
  330. :host([scale=s][range-hover]:first-child) .calcite--rtl .day-wrapper {
  331. box-shadow: inset -1px 0px 0px 0px var(--calcite-ui-foreground-1);
  332. }
  333. :host([scale=s][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,
  334. :host([scale=s][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,
  335. :host([scale=s][highlighted]:last-child) .calcite--rtl .day-wrapper,
  336. :host([scale=s][range-hover]:last-child) .calcite--rtl .day-wrapper {
  337. box-shadow: inset 1px 0px 0px 0px var(--calcite-ui-foreground-1);
  338. }
  339. :host([scale=l][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,
  340. :host([scale=l][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,
  341. :host([scale=l][highlighted]:last-child) .calcite--rtl .day-wrapper,
  342. :host([scale=l][range-hover]:last-child) .calcite--rtl .day-wrapper {
  343. box-shadow: inset 6px 0px 0px 0px var(--calcite-ui-foreground-1);
  344. }
  345. :host([highlighted]:first-child) .day-wrapper,
  346. :host([range-hover]:first-child) .day-wrapper {
  347. border-start-start-radius: 45%;
  348. border-end-start-radius: 45%;
  349. }
  350. :host([highlighted]:last-child) .day-wrapper,
  351. :host([range-hover]:last-child) .day-wrapper {
  352. border-start-end-radius: 45%;
  353. border-end-end-radius: 45%;
  354. }
  355. :host([scale=l][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,
  356. :host([scale=l][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,
  357. :host([scale=l][highlighted]:first-child) .calcite--rtl .day-wrapper,
  358. :host([scale=l][range-hover]:first-child) .calcite--rtl .day-wrapper {
  359. box-shadow: inset -6px 0px 0px 0px var(--calcite-ui-foreground-1);
  360. }
  361. @media (forced-colors: active) {
  362. :host(:hover:not([disabled])) .day, :host([active]:not([range])) .day {
  363. border-radius: 0px;
  364. }
  365. :host([selected]) {
  366. outline: 2px solid canvasText;
  367. z-index: 1;
  368. }
  369. :host([selected]) .day {
  370. border-radius: 0px;
  371. background-color: highlight;
  372. }
  373. :host([range][selected]) .day-wrapper,
  374. :host([highlighted]) .day-wrapper,
  375. :host([range-hover]:not([selected])) .day-wrapper {
  376. background-color: highlight;
  377. }
  378. :host([range][selected][start-of-range]) .day-wrapper,
  379. :host([range][selected][end-of-range]) .day-wrapper {
  380. background-color: canvas;
  381. }
  382. }