tab-title.css 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. /**
  65. * Currently only used in Checkbox.
  66. */
  67. :root {
  68. --calcite-popper-transition: var(--calcite-animation-timing);
  69. }
  70. :host([hidden]) {
  71. display: none;
  72. }
  73. :host {
  74. margin-right: 1.25rem;
  75. display: block;
  76. flex: 0 1 auto;
  77. outline: 2px solid transparent;
  78. outline-offset: 2px;
  79. margin-inline-start: 0px;
  80. margin-inline-end: 1.25rem;
  81. }
  82. :host([layout=center]) {
  83. margin-top: 0px;
  84. margin-bottom: 0px;
  85. margin-left: 1.25rem;
  86. margin-right: 1.25rem;
  87. text-align: center;
  88. flex-basis: 12rem;
  89. }
  90. :host([position=below]) a {
  91. border-bottom-width: 0px;
  92. border-top-width: 2px;
  93. border-top-color: transparent;
  94. border-top-style: solid;
  95. }
  96. :host a {
  97. outline-offset: 0;
  98. outline-color: transparent;
  99. transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
  100. }
  101. :host(:focus) a {
  102. outline: 2px solid var(--calcite-ui-brand);
  103. outline-offset: -2px;
  104. }
  105. :host(:active) a, :host(:focus) a, :host(:hover) a {
  106. border-color: var(--calcite-ui-border-2);
  107. color: var(--calcite-ui-text-1);
  108. -webkit-text-decoration-line: none;
  109. text-decoration-line: none;
  110. }
  111. :host([active]) a {
  112. border-color: transparent;
  113. color: var(--calcite-ui-text-1);
  114. }
  115. :host([disabled]) {
  116. pointer-events: none;
  117. cursor: default;
  118. -webkit-user-select: none;
  119. user-select: none;
  120. opacity: var(--calcite-ui-opacity-disabled);
  121. }
  122. :host([disabled]) span, :host([disabled]) a {
  123. pointer-events: none;
  124. opacity: 0.5;
  125. }
  126. :host([disabled]) ::slotted([calcite-hydrated][disabled]),
  127. :host([disabled]) [calcite-hydrated][disabled] {
  128. /* prevent opacity stacking */
  129. opacity: 1;
  130. }
  131. :host([scale=s]) {
  132. margin-inline-end: 1rem;
  133. }
  134. :host([scale=s]) a, :host([scale=s]) span {
  135. padding-top: 0.25rem;
  136. padding-bottom: 0.25rem;
  137. font-size: var(--calcite-font-size--2);
  138. line-height: 1rem;
  139. }
  140. :host([scale=m]) a, :host([scale=m]) span {
  141. padding-top: 0.5rem;
  142. padding-bottom: 0.5rem;
  143. font-size: var(--calcite-font-size--1);
  144. line-height: 1rem;
  145. }
  146. :host([scale=l]) {
  147. margin-inline-end: 1.5rem;
  148. }
  149. :host([scale=l]) a, :host([scale=l]) span {
  150. padding-top: 0.75rem;
  151. padding-bottom: 0.75rem;
  152. font-size: var(--calcite-font-size-0);
  153. line-height: 1.25rem;
  154. }
  155. a, span {
  156. box-sizing: border-box;
  157. display: flex;
  158. height: 100%;
  159. width: 100%;
  160. cursor: pointer;
  161. -webkit-appearance: none;
  162. appearance: none;
  163. justify-content: center;
  164. overflow: hidden;
  165. text-overflow: ellipsis;
  166. white-space: nowrap;
  167. border-bottom-width: 2px;
  168. padding-left: 0px;
  169. padding-right: 0px;
  170. padding-top: 0.5rem;
  171. padding-bottom: 0.5rem;
  172. font-size: var(--calcite-font-size--1);
  173. line-height: 1rem;
  174. color: var(--calcite-ui-text-3);
  175. transition-property: all;
  176. transition-duration: var(--calcite-animation-timing);
  177. transition-timing-function: ease-in-out;
  178. transition-delay: 0s;
  179. border-bottom-color: transparent;
  180. border-bottom-style: solid;
  181. }
  182. span {
  183. cursor: default;
  184. }
  185. .calcite-tab-title--icon {
  186. position: relative;
  187. margin: 0px;
  188. display: inline-flex;
  189. align-self: center;
  190. }
  191. .calcite-tab-title--icon svg {
  192. transition-property: all;
  193. transition-duration: var(--calcite-animation-timing);
  194. transition-timing-function: ease-in-out;
  195. transition-delay: 0s;
  196. }
  197. .container--has-text {
  198. padding: 0.25rem;
  199. }
  200. .container--has-text .calcite-tab-title--icon.icon-start {
  201. margin-inline-end: 0.5rem;
  202. }
  203. .container--has-text .calcite-tab-title--icon.icon-end {
  204. margin-inline-start: 0.5rem;
  205. }
  206. :host([icon-start][icon-end]) .calcite-tab-title--icon:first-child {
  207. margin-inline-end: 0.5rem;
  208. }
  209. :host([bordered]) {
  210. margin-inline-end: 0;
  211. }
  212. :host([bordered][active]) {
  213. box-shadow: inset 0px -2px var(--calcite-ui-foreground-1);
  214. }
  215. :host([bordered][active][position=below]) {
  216. box-shadow: inset 0 2px 0 var(--calcite-ui-foreground-1);
  217. }
  218. :host([bordered]:hover) a, :host([bordered]:focus) a, :host([bordered]:active) a {
  219. position: relative;
  220. }
  221. :host([bordered]:hover) a {
  222. background-color: var(--calcite-button-transparent-hover);
  223. transition-property: all;
  224. transition-duration: var(--calcite-animation-timing);
  225. transition-timing-function: ease-in-out;
  226. transition-delay: 0s;
  227. }
  228. :host([bordered]) a {
  229. border-bottom-style: unset;
  230. }
  231. :host([bordered][position=below]) a {
  232. border-top-style: unset;
  233. }
  234. :host([active][bordered]) a {
  235. border-left: 1px solid var(--calcite-ui-border-1);
  236. border-right: 1px solid var(--calcite-ui-border-1);
  237. }
  238. :host([bordered]) a, :host([bordered]) span {
  239. padding-left: 0.75rem;
  240. padding-right: 0.75rem;
  241. }
  242. :host([bordered][scale=s]) a, :host([bordered][scale=s]) span {
  243. padding-left: 0.5rem;
  244. padding-right: 0.5rem;
  245. }
  246. :host([bordered][scale=l]) a, :host([bordered][scale=l]) span {
  247. padding-left: 1rem;
  248. padding-right: 1rem;
  249. }