shell-panel.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. pointer-events: none;
  80. display: flex;
  81. flex: 0 1 auto;
  82. align-items: stretch;
  83. --calcite-shell-panel-detached-max-height: unset;
  84. }
  85. .container {
  86. pointer-events: none;
  87. box-sizing: border-box;
  88. display: flex;
  89. flex: 1 1 auto;
  90. align-items: stretch;
  91. background-color: transparent;
  92. font-size: var(--calcite-font-size--1);
  93. color: var(--calcite-ui-text-2);
  94. }
  95. .container * {
  96. box-sizing: border-box;
  97. }
  98. :host(:hover) .separator:not(:hover):not(:focus),
  99. :host(:focus-within) .separator:not(:hover):not(:focus) {
  100. opacity: 1;
  101. background-color: var(--calcite-ui-border-3);
  102. }
  103. .separator {
  104. pointer-events: auto;
  105. position: absolute;
  106. inset-block: 0px;
  107. display: flex;
  108. block-size: 100%;
  109. inline-size: 0.125rem;
  110. background-color: transparent;
  111. opacity: 0;
  112. transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;
  113. cursor: col-resize;
  114. outline: none;
  115. }
  116. .separator:hover {
  117. opacity: 1;
  118. background-color: var(--calcite-ui-border-2);
  119. }
  120. .separator:focus {
  121. background-color: var(--calcite-ui-brand);
  122. opacity: 1;
  123. }
  124. :host([position=start]) .separator {
  125. inset-inline-end: -2px;
  126. }
  127. :host([position=end]) .separator {
  128. inset-inline-start: -2px;
  129. }
  130. ::slotted(calcite-panel),
  131. ::slotted(calcite-flow) {
  132. block-size: 100%;
  133. inline-size: 100%;
  134. flex: 1 1 auto;
  135. max-block-size: unset;
  136. max-inline-size: unset;
  137. }
  138. ::slotted(.calcite-match-height) {
  139. display: flex;
  140. flex: 1 1 auto;
  141. overflow: hidden;
  142. }
  143. .content {
  144. pointer-events: auto;
  145. display: flex;
  146. flex-direction: column;
  147. flex-wrap: nowrap;
  148. align-items: stretch;
  149. align-self: stretch;
  150. background-color: var(--calcite-ui-background);
  151. padding: 0px;
  152. inline-size: var(--calcite-shell-panel-width);
  153. max-inline-size: var(--calcite-shell-panel-max-width);
  154. min-inline-size: var(--calcite-shell-panel-min-width);
  155. transition: max-block-size var(--calcite-animation-timing), max-inline-size var(--calcite-animation-timing);
  156. }
  157. .content__header {
  158. display: flex;
  159. flex: 0 1 auto;
  160. flex-direction: column;
  161. flex-wrap: nowrap;
  162. align-items: stretch;
  163. }
  164. .content__body {
  165. display: flex;
  166. flex: 1 1 auto;
  167. flex-direction: column;
  168. overflow: hidden;
  169. }
  170. :host([width-scale=s]) .content {
  171. --calcite-shell-panel-width: calc(var(--calcite-panel-width-multiplier) * 12vw);
  172. --calcite-shell-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 300px);
  173. --calcite-shell-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 150px);
  174. }
  175. :host([width-scale=m]) .content {
  176. --calcite-shell-panel-width: calc(var(--calcite-panel-width-multiplier) * 20vw);
  177. --calcite-shell-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 420px);
  178. --calcite-shell-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 240px);
  179. }
  180. :host([width-scale=l]) .content {
  181. --calcite-shell-panel-width: calc(var(--calcite-panel-width-multiplier) * 45vw);
  182. --calcite-shell-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 680px);
  183. --calcite-shell-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 340px);
  184. }
  185. :host([detached-height-scale=s]) .content--detached {
  186. --calcite-shell-panel-detached-max-height: 40vh;
  187. }
  188. :host([detached-height-scale=m]) .content--detached {
  189. --calcite-shell-panel-detached-max-height: 60vh;
  190. }
  191. :host([detached-height-scale=l]) .content--detached {
  192. --calcite-shell-panel-detached-max-height: 80vh;
  193. }
  194. .content--detached {
  195. margin-inline: 0.5rem;
  196. margin-block: 0.5rem auto;
  197. block-size: auto;
  198. overflow: hidden;
  199. border-radius: 0.25rem;
  200. --tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  201. --tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);
  202. box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  203. max-block-size: var(--calcite-shell-panel-detached-max-height);
  204. }
  205. .content--detached ::slotted(calcite-panel),
  206. .content--detached ::slotted(calcite-flow) {
  207. max-block-size: unset;
  208. }
  209. :host([position=start]) .content--detached ::slotted(calcite-panel),
  210. :host([position=start]) .content--detached ::slotted(calcite-flow),
  211. :host([position=end]) .content--detached ::slotted(calcite-panel),
  212. :host([position=end]) .content--detached ::slotted(calcite-flow) {
  213. border-style: none;
  214. }
  215. .content[hidden] {
  216. display: none;
  217. }
  218. slot[name=action-bar]::slotted(calcite-action-bar),
  219. .content ::slotted(calcite-flow),
  220. .content ::slotted(calcite-panel:not([dismissed])) {
  221. border-width: 1px;
  222. border-style: solid;
  223. border-color: var(--calcite-ui-border-3);
  224. }
  225. :host([position=start]) slot[name=action-bar]::slotted(calcite-action-bar),
  226. :host([position=start]) .content ::slotted(calcite-flow),
  227. :host([position=start]) .content ::slotted(calcite-panel) {
  228. border-inline-start: none;
  229. }
  230. :host([position=end]) slot[name=action-bar]::slotted(calcite-action-bar),
  231. :host([position=end]) .content ::slotted(calcite-flow),
  232. :host([position=end]) .content ::slotted(calcite-panel) {
  233. border-inline-end: none;
  234. }