label.css 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. display: inline;
  75. }
  76. :host([alignment=start]) {
  77. text-align: start;
  78. }
  79. :host([alignment=end]) {
  80. text-align: end;
  81. }
  82. :host([alignment=center]) {
  83. text-align: center;
  84. }
  85. :host([scale=s]) .container {
  86. margin-bottom: 0.5rem;
  87. font-size: var(--calcite-font-size--2);
  88. line-height: 1rem;
  89. }
  90. :host([scale=m]) .container {
  91. margin-bottom: 0.75rem;
  92. font-size: var(--calcite-font-size--1);
  93. line-height: 1rem;
  94. }
  95. :host([scale=l]) .container {
  96. margin-bottom: 1rem;
  97. font-size: var(--calcite-font-size-0);
  98. line-height: 1.25rem;
  99. }
  100. :host .container {
  101. margin-top: 0px;
  102. margin-right: 0px;
  103. margin-left: 0px;
  104. width: 100%;
  105. line-height: 1.375;
  106. color: var(--calcite-ui-text-1);
  107. }
  108. :host([layout=default]) .container {
  109. display: flex;
  110. flex-direction: column;
  111. gap: 0.25rem;
  112. }
  113. :host([layout=inline]) .container, :host([layout=inline-space-between]) .container {
  114. display: flex;
  115. flex-direction: row;
  116. align-items: center;
  117. gap: 0.5rem;
  118. }
  119. :host([layout=inline][scale=l]) .container {
  120. gap: 0.75rem;
  121. }
  122. :host([layout=inline-space-between]) .container {
  123. justify-content: space-between;
  124. }
  125. :host([disabled]) {
  126. pointer-events: none;
  127. cursor: default;
  128. -webkit-user-select: none;
  129. user-select: none;
  130. opacity: var(--calcite-ui-opacity-disabled);
  131. }
  132. :host([disabled]) > .container {
  133. pointer-events: none;
  134. opacity: var(--calcite-ui-opacity-disabled);
  135. }
  136. :host([disabled]) ::slotted(*) {
  137. pointer-events: none;
  138. }
  139. :host([disabled]) ::slotted(*[disabled]), :host([disabled]) ::slotted(*[disabled] *) {
  140. --tw-bg-opacity: 1;
  141. }
  142. :host([disabled]) ::slotted(calcite-input-message:not([active])) {
  143. --tw-bg-opacity: 0;
  144. }
  145. :host([disabled]) ::slotted([calcite-hydrated][disabled]),
  146. :host([disabled]) [calcite-hydrated][disabled] {
  147. /* prevent opacity stacking */
  148. opacity: 1;
  149. }
  150. :host([disable-spacing]) .container {
  151. margin: 0px;
  152. gap: 0px;
  153. }