card.css 4.9 KB

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