date-picker-month-header.css 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. @media (prefers-reduced-motion: reduce) {
  65. :root {
  66. --calcite-internal-duration-factor: 0.01;
  67. }
  68. }
  69. /**
  70. * Currently only used in Checkbox.
  71. */
  72. :root {
  73. --calcite-floating-ui-transition: var(--calcite-animation-timing);
  74. }
  75. :host([hidden]) {
  76. display: none;
  77. }
  78. :host {
  79. display: block;
  80. }
  81. .header {
  82. display: flex;
  83. justify-content: space-between;
  84. padding-block: 0px;
  85. padding-inline: 0.25rem;
  86. }
  87. :host([scale=s]) .text {
  88. margin-block: 0.5rem;
  89. font-size: var(--calcite-font-size--1);
  90. line-height: 1rem;
  91. }
  92. :host([scale=s]) .chevron {
  93. block-size: 2.25rem;
  94. }
  95. :host([scale=m]) .text {
  96. margin-block: 0.75rem;
  97. font-size: var(--calcite-font-size-0);
  98. line-height: 1.25rem;
  99. }
  100. :host([scale=m]) .chevron {
  101. block-size: 3rem;
  102. }
  103. :host([scale=l]) .text {
  104. margin-block: 1rem;
  105. font-size: var(--calcite-font-size-1);
  106. line-height: 1.5rem;
  107. }
  108. :host([scale=l]) .chevron {
  109. block-size: 3.5rem;
  110. }
  111. .chevron {
  112. margin-inline: -0.25rem;
  113. box-sizing: content-box;
  114. display: flex;
  115. flex-grow: 0;
  116. cursor: pointer;
  117. align-items: center;
  118. justify-content: center;
  119. border-style: none;
  120. background-color: var(--calcite-ui-foreground-1);
  121. padding-inline: 0.25rem;
  122. color: var(--calcite-ui-text-3);
  123. outline: 2px solid transparent;
  124. outline-offset: 2px;
  125. outline-color: transparent;
  126. transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;
  127. inline-size: 14.2857142857%;
  128. }
  129. .chevron:focus {
  130. outline: 2px solid var(--calcite-ui-brand);
  131. outline-offset: -2px;
  132. }
  133. .chevron:hover, .chevron:focus {
  134. background-color: var(--calcite-ui-foreground-2);
  135. fill: var(--calcite-ui-text-1);
  136. color: var(--calcite-ui-text-1);
  137. }
  138. .chevron:active {
  139. background-color: var(--calcite-ui-foreground-3);
  140. }
  141. .chevron[aria-disabled=true] {
  142. pointer-events: none;
  143. opacity: 0;
  144. }
  145. .text {
  146. margin-block: auto;
  147. display: flex;
  148. inline-size: 100%;
  149. flex: 1 1 auto;
  150. align-items: center;
  151. justify-content: center;
  152. text-align: center;
  153. line-height: 1;
  154. }
  155. .text--reverse {
  156. flex-direction: row-reverse;
  157. }
  158. .month,
  159. .year,
  160. .suffix {
  161. margin-inline: 0.25rem;
  162. margin-block: auto;
  163. display: inline-block;
  164. background-color: var(--calcite-ui-foreground-1);
  165. font-weight: var(--calcite-font-weight-medium);
  166. line-height: 1.25;
  167. color: var(--calcite-ui-text-1);
  168. font-size: inherit;
  169. }
  170. .year {
  171. position: relative;
  172. inline-size: 2.5rem;
  173. border-style: none;
  174. background-color: transparent;
  175. text-align: center;
  176. font-family: inherit;
  177. outline-color: transparent;
  178. }
  179. .year:hover {
  180. transition-duration: 100ms;
  181. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  182. transition-property: outline-color;
  183. outline: 2px solid var(--calcite-ui-border-2);
  184. outline-offset: 2px;
  185. }
  186. .year:focus {
  187. outline: 2px solid var(--calcite-ui-brand);
  188. outline-offset: 2px;
  189. }
  190. .year--suffix {
  191. text-align: start;
  192. }
  193. .year-wrap {
  194. position: relative;
  195. }
  196. .suffix {
  197. inset-block-start: 0px;
  198. white-space: nowrap;
  199. text-align: start;
  200. inset-inline-start: 0;
  201. }