tab-nav.css 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. position: relative;
  80. display: flex;
  81. }
  82. :host([scale=s]) {
  83. min-block-size: 1.5rem;
  84. }
  85. :host([scale=m]) {
  86. min-block-size: 2rem;
  87. }
  88. :host([scale=l]) {
  89. min-block-size: 2.75rem;
  90. }
  91. .tab-nav {
  92. display: flex;
  93. inline-size: 100%;
  94. justify-content: flex-start;
  95. overflow: auto;
  96. }
  97. .tab-nav-active-indicator-container {
  98. position: absolute;
  99. inset-inline: 0px;
  100. inset-block-end: 0px;
  101. block-size: 0.125rem;
  102. inline-size: 100%;
  103. overflow: hidden;
  104. }
  105. .tab-nav-active-indicator {
  106. position: absolute;
  107. inset-block-end: 0px;
  108. display: block;
  109. block-size: 0.125rem;
  110. background-color: var(--calcite-ui-brand);
  111. transition-property: all;
  112. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  113. transition-duration: 150ms;
  114. transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
  115. }
  116. :host([position=below]) .tab-nav-active-indicator {
  117. inset-block-end: unset;
  118. inset-block-start: 0px;
  119. }
  120. :host([position=bottom]) .tab-nav-active-indicator {
  121. inset-block-end: unset;
  122. inset-block-start: 0px;
  123. }
  124. :host([position=below]) .tab-nav-active-indicator-container {
  125. inset-block-start: 0px;
  126. inset-block-end: unset;
  127. }
  128. :host([position=bottom]) .tab-nav-active-indicator-container {
  129. inset-block-end: unset;
  130. inset-block-start: 0px;
  131. }
  132. :host([bordered]) .tab-nav-active-indicator-container {
  133. inset-block-end: unset;
  134. }
  135. :host([bordered][position=below]) .tab-nav-active-indicator-container {
  136. inset-block-end: 0;
  137. inset-block-start: unset;
  138. }
  139. :host([bordered][position=bottom]) .tab-nav-active-indicator-container {
  140. inset-block-end: 0;
  141. inset-block-start: unset;
  142. }
  143. @media (forced-colors: active) {
  144. .tab-nav-active-indicator {
  145. background-color: highlight;
  146. }
  147. }