card.css 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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: block;
  75. max-width: 100%;
  76. }
  77. :host .calcite-card-container {
  78. position: relative;
  79. display: flex;
  80. height: 100%;
  81. flex-direction: column;
  82. justify-content: space-between;
  83. border-width: 1px;
  84. border-style: solid;
  85. border-color: var(--calcite-ui-border-2);
  86. background-color: var(--calcite-ui-foreground-1);
  87. color: var(--calcite-ui-text-3);
  88. --tw-shadow: 0 0 #0000;
  89. --tw-shadow-colored: 0 0 #0000;
  90. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  91. transition-duration: 150ms;
  92. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  93. border-radius: var(--calcite-border-radius-base);
  94. }
  95. :host .calcite-card-container:hover {
  96. --tw-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08), 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  97. --tw-shadow-colored: 0 4px 16px 0 var(--tw-shadow-color), 0 2px 8px 0 var(--tw-shadow-color);
  98. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  99. z-index: 1;
  100. }
  101. :host .calcite-card-container:active {
  102. --tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, 0.16), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  103. --tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
  104. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  105. transition-duration: 75ms;
  106. z-index: 1;
  107. }
  108. .container {
  109. display: flex;
  110. flex: 1 1 auto;
  111. flex-direction: column;
  112. }
  113. :host([loading]) .calcite-card-container *:not(calcite-loader):not(.calcite-card-loader-container) {
  114. pointer-events: none;
  115. opacity: 0;
  116. }
  117. :host([loading]) .calcite-card-loader-container {
  118. position: absolute;
  119. top: 0px;
  120. right: 0px;
  121. bottom: 0px;
  122. left: 0px;
  123. display: flex;
  124. align-items: center;
  125. }
  126. .header, .footer {
  127. display: flex;
  128. padding-left: 0.75rem;
  129. padding-right: 0.75rem;
  130. padding-top: 0.75rem;
  131. padding-bottom: 0.25rem;
  132. }
  133. .header {
  134. flex-direction: column;
  135. }
  136. .footer {
  137. margin-top: auto;
  138. flex-direction: row;
  139. align-content: space-between;
  140. justify-content: space-between;
  141. padding-left: 0.75rem;
  142. padding-right: 0.75rem;
  143. padding-top: 0.25rem;
  144. padding-bottom: 0.75rem;
  145. }
  146. .card-content {
  147. padding: 0.75rem;
  148. font-size: var(--calcite-font-size--2);
  149. line-height: 1.375;
  150. color: var(--calcite-ui-text-3);
  151. }
  152. :host([selectable]) .calcite-card-container:active {
  153. --tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, 0.16), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  154. --tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
  155. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  156. }
  157. :host([selected]) .calcite-card-container {
  158. border-color: var(--calcite-ui-brand);
  159. }
  160. slot[name=title]::slotted(*), *::slotted([slot=title]) {
  161. margin: 0px;
  162. font-size: var(--calcite-font-size--1);
  163. line-height: 1.375;
  164. font-weight: var(--calcite-font-weight-medium);
  165. color: var(--calcite-ui-text-1);
  166. }
  167. slot[name=subtitle]::slotted(*), *::slotted([slot=subtitle]) {
  168. margin: 0px;
  169. margin-top: 0.5rem;
  170. font-size: var(--calcite-font-size--2);
  171. line-height: 1.375;
  172. font-weight: var(--calcite-font-weight-normal);
  173. color: var(--calcite-ui-text-2);
  174. }
  175. slot[name=thumbnail]::slotted(img), img::slotted([slot=thumbnail]) {
  176. min-width: 100%;
  177. max-width: 100%;
  178. }
  179. slot[name=footer-leading]::slotted(*), *::slotted([slot=footer-leading]) {
  180. align-self: center;
  181. font-size: var(--calcite-font-size--2);
  182. line-height: 1.375;
  183. margin-inline-end: auto;
  184. }
  185. slot[name=footer-trailing]::slotted(*), *::slotted([slot=footer-trailing]) {
  186. align-self: center;
  187. font-size: var(--calcite-font-size--2);
  188. line-height: 1.375;
  189. }
  190. .thumbnail-wrapper {
  191. font-size: var(--calcite-font-size-0);
  192. line-height: 1.375;
  193. }
  194. .checkbox-wrapper {
  195. position: absolute;
  196. margin: 0px;
  197. padding: 0px;
  198. top: 0.5rem;
  199. inset-inline-end: 0.5rem;
  200. }