popover.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. position: absolute;
  81. z-index: 900;
  82. }
  83. .calcite-floating-ui-anim {
  84. position: relative;
  85. transition: var(--calcite-floating-ui-transition);
  86. visibility: hidden;
  87. transition-property: transform, visibility, opacity;
  88. opacity: 0;
  89. box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.16);
  90. z-index: 1;
  91. border-radius: 0.25rem;
  92. }
  93. :host([data-placement^=bottom]) .calcite-floating-ui-anim {
  94. transform: translateY(-5px);
  95. }
  96. :host([data-placement^=top]) .calcite-floating-ui-anim {
  97. transform: translateY(5px);
  98. }
  99. :host([data-placement^=left]) .calcite-floating-ui-anim {
  100. transform: translateX(5px);
  101. }
  102. :host([data-placement^=right]) .calcite-floating-ui-anim {
  103. transform: translateX(-5px);
  104. }
  105. :host([data-placement]) .calcite-floating-ui-anim--active {
  106. opacity: 1;
  107. visibility: visible;
  108. transform: translate(0);
  109. }
  110. :host([calcite-hydrated-hidden]) {
  111. visibility: hidden !important;
  112. pointer-events: none;
  113. }
  114. .arrow,
  115. .arrow::before {
  116. position: absolute;
  117. inline-size: 8px;
  118. block-size: 8px;
  119. z-index: -1;
  120. }
  121. .arrow::before {
  122. content: "";
  123. --tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  124. --tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);
  125. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  126. transform: rotate(45deg);
  127. background: var(--calcite-ui-foreground-1);
  128. }
  129. :host([data-placement^=top]) .arrow {
  130. inset-block-end: -4px;
  131. }
  132. :host([data-placement^=bottom]) .arrow {
  133. inset-block-start: -4px;
  134. }
  135. :host([data-placement^=left]) .arrow {
  136. direction: ltr;
  137. inset-inline-end: -4px;
  138. }
  139. :host([data-placement^=right]) .arrow {
  140. direction: ltr;
  141. inset-inline-start: -4px;
  142. }
  143. :host {
  144. pointer-events: none;
  145. }
  146. :host([open]) {
  147. pointer-events: initial;
  148. }
  149. .calcite-floating-ui-anim {
  150. border-radius: 0.25rem;
  151. border-width: 1px;
  152. border-style: solid;
  153. border-color: var(--calcite-ui-border-3);
  154. background-color: var(--calcite-ui-foreground-1);
  155. }
  156. .arrow::before {
  157. outline: 1px solid var(--calcite-ui-border-3);
  158. }
  159. .header {
  160. display: flex;
  161. flex: 1 1 auto;
  162. align-items: stretch;
  163. justify-content: flex-start;
  164. border-width: 0px;
  165. border-block-end-width: 1px;
  166. border-style: solid;
  167. background-color: var(--calcite-ui-foreground-1);
  168. border-block-end-color: var(--calcite-ui-border-3);
  169. }
  170. .heading {
  171. margin: 0px;
  172. display: block;
  173. flex: 1 1 auto;
  174. align-self: center;
  175. white-space: normal;
  176. padding-inline: 1rem;
  177. padding-block: 0.75rem;
  178. font-size: var(--calcite-font-size-0);
  179. line-height: 1.375;
  180. font-weight: var(--calcite-font-weight-medium);
  181. color: var(--calcite-ui-text-1);
  182. word-wrap: break-word;
  183. word-break: break-word;
  184. }
  185. .container {
  186. position: relative;
  187. display: flex;
  188. block-size: 100%;
  189. flex-direction: row;
  190. flex-wrap: nowrap;
  191. border-radius: 0.25rem;
  192. background-color: var(--calcite-ui-foreground-1);
  193. color: var(--calcite-ui-text-1);
  194. }
  195. .container.has-header {
  196. flex-direction: column;
  197. }
  198. .content {
  199. display: flex;
  200. block-size: 100%;
  201. inline-size: 100%;
  202. flex-direction: column;
  203. flex-wrap: nowrap;
  204. align-self: center;
  205. word-wrap: break-word;
  206. word-break: break-word;
  207. }
  208. .close-button-container {
  209. display: flex;
  210. overflow: hidden;
  211. flex: 0 0 auto;
  212. border-start-end-radius: 0.25rem;
  213. border-end-end-radius: 0.25rem;
  214. }
  215. ::slotted(calcite-panel),
  216. ::slotted(calcite-flow) {
  217. block-size: 100%;
  218. }