input-message.css 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. /**
  74. * CSS Custom Properties
  75. *
  76. * These properties can be overridden using the component's tag as selector.
  77. *
  78. * @prop --calcite-input-message-spacing-value: the top margin above the input-message.
  79. */
  80. :host([active][scale=m]),
  81. :host([active][scale=l]) {
  82. --calcite-input-message-spacing-value: 0.25rem;
  83. }
  84. :host {
  85. visibility: hidden;
  86. box-sizing: border-box;
  87. display: flex;
  88. height: 0px;
  89. width: 100%;
  90. align-items: center;
  91. font-weight: var(--calcite-font-weight-medium);
  92. color: var(--calcite-ui-text-1);
  93. opacity: 0;
  94. transition-property: all;
  95. transition-duration: var(--calcite-animation-timing);
  96. transition-timing-function: ease-in-out;
  97. transition-delay: 0s;
  98. }
  99. :host([active]) {
  100. visibility: visible;
  101. height: auto;
  102. opacity: 1;
  103. transition-property: all;
  104. transition-duration: var(--calcite-animation-timing);
  105. transition-timing-function: ease-in-out;
  106. transition-delay: 0s;
  107. }
  108. :host([active][scale=m]),
  109. :host([active][scale=l]) {
  110. margin-top: var(--calcite-input-message-spacing-value);
  111. }
  112. .calcite-input-message-icon {
  113. pointer-events: none;
  114. display: inline-flex;
  115. flex-shrink: 0;
  116. transition-property: all;
  117. transition-duration: var(--calcite-animation-timing);
  118. transition-timing-function: ease-in-out;
  119. transition-delay: 0s;
  120. margin-inline-end: 0.5rem;
  121. }
  122. :host([status=invalid]) .calcite-input-message-icon {
  123. color: var(--calcite-ui-danger);
  124. }
  125. :host([status=warning]) .calcite-input-message-icon {
  126. color: var(--calcite-ui-warning);
  127. }
  128. :host([status=valid]) .calcite-input-message-icon {
  129. color: var(--calcite-ui-success);
  130. }
  131. :host([status=idle]) .calcite-input-message-icon {
  132. color: var(--calcite-ui-brand);
  133. }
  134. :host([status][active]) {
  135. font-weight: var(--calcite-font-weight-medium);
  136. color: var(--calcite-ui-text-1);
  137. }
  138. :host([status][active][scale=s]) {
  139. font-size: var(--calcite-font-size--3);
  140. line-height: 0.75rem;
  141. }
  142. :host([status][active][scale=m]) {
  143. margin-top: 0.25rem;
  144. font-size: var(--calcite-font-size--2);
  145. line-height: 1rem;
  146. }
  147. :host([status][active][scale=l]) {
  148. margin-top: 0.25rem;
  149. font-size: var(--calcite-font-size--1);
  150. line-height: 1rem;
  151. }