tabs.css 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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: flex;
  80. flex-direction: column;
  81. }
  82. :host([bordered]) {
  83. box-shadow: inset 0 1px 0 var(--calcite-ui-border-1);
  84. background-color: var(--calcite-ui-foreground-1);
  85. }
  86. :host([bordered]:not([position=below])) ::slotted(calcite-tab-nav) {
  87. margin-block-end: -1px;
  88. }
  89. :host([bordered]:not([position=bottom])) ::slotted(calcite-tab-nav) {
  90. margin-block-end: -1px;
  91. }
  92. :host([bordered][position=below]) ::slotted(calcite-tab-nav) {
  93. margin-block-start: -1px;
  94. }
  95. :host([bordered][position=below]) {
  96. box-shadow: inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1);
  97. }
  98. :host([bordered][position=bottom]) {
  99. box-shadow: inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1);
  100. }
  101. :host([bordered]) section {
  102. border-width: 1px;
  103. border-style: solid;
  104. border-color: var(--calcite-ui-border-1);
  105. }
  106. :host([bordered][scale=s]) section {
  107. padding: 0.75rem;
  108. }
  109. :host([bordered][scale=m]) section {
  110. padding: 0.5rem;
  111. }
  112. :host([bordered][scale=l]) section {
  113. padding: 1rem;
  114. }
  115. :host([position=below]) {
  116. flex-direction: column-reverse;
  117. }
  118. :host([position=bottom]) {
  119. flex-direction: column-reverse;
  120. }
  121. section {
  122. display: flex;
  123. flex-grow: 1;
  124. overflow: hidden;
  125. border-block-start-width: 1px;
  126. border-block-start-color: var(--calcite-ui-border-1);
  127. border-block-start-style: solid;
  128. }
  129. :host([position=below]) section {
  130. flex-direction: column-reverse;
  131. border-block-start-width: 0px;
  132. border-block-end-width: 1px;
  133. border-block-end-color: var(--calcite-ui-border-1);
  134. }
  135. :host([position=bottom]) section {
  136. flex-direction: column-reverse;
  137. border-block-start-width: 0px;
  138. border-block-end-width: 1px;
  139. border-block-end-color: var(--calcite-ui-border-1);
  140. }
  141. :host([position=below]:not([bordered])) section {
  142. border-block-end-style: solid;
  143. }
  144. :host([position=bottom]:not([bordered])) section {
  145. border-block-end-style: solid;
  146. }
  147. @media (forced-colors: active) {
  148. :host([bordered]) section {
  149. border-block-start-width: 0px;
  150. border-block-end-width: 1px;
  151. }
  152. :host([position=below][bordered]) section {
  153. border-block-start-width: 1px;
  154. border-block-end-width: 0px;
  155. }
  156. :host([position=bottom][bordered]) section {
  157. border-block-start-width: 1px;
  158. border-block-end-width: 0px;
  159. }
  160. }