stepper-item.css 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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([scale=s]) {
  74. --calcite-stepper-item-spacing-unit-s: 0.25rem;
  75. --calcite-stepper-item-spacing-unit-m: 0.75rem;
  76. --calcite-stepper-item-spacing-unit-l: 1rem;
  77. font-size: var(--calcite-font-size--1);
  78. line-height: 1rem;
  79. margin-inline-end: 0.25rem;
  80. }
  81. :host([scale=s]) .stepper-item-subtitle {
  82. font-size: var(--calcite-font-size--2);
  83. line-height: 1rem;
  84. }
  85. :host([scale=m]) {
  86. --calcite-stepper-item-spacing-unit-s: 0.5rem;
  87. --calcite-stepper-item-spacing-unit-m: 1rem;
  88. --calcite-stepper-item-spacing-unit-l: 1.25rem;
  89. font-size: var(--calcite-font-size-0);
  90. line-height: 1.25rem;
  91. margin-inline-end: 0.5rem;
  92. }
  93. :host([scale=m]) .stepper-item-subtitle {
  94. font-size: var(--calcite-font-size--1);
  95. line-height: 1rem;
  96. }
  97. :host([scale=l]) {
  98. --calcite-stepper-item-spacing-unit-s: 0.75rem;
  99. --calcite-stepper-item-spacing-unit-m: 1.25rem;
  100. --calcite-stepper-item-spacing-unit-l: 1.5rem;
  101. font-size: var(--calcite-font-size-1);
  102. line-height: 1.5rem;
  103. margin-inline-end: 0.75rem;
  104. }
  105. :host([scale=l]) .stepper-item-subtitle {
  106. font-size: var(--calcite-font-size-0);
  107. line-height: 1.25rem;
  108. }
  109. :host {
  110. position: relative;
  111. display: flex;
  112. flex-grow: 1;
  113. flex-direction: column;
  114. margin-bottom: var(--calcite-stepper-item-spacing-unit-s);
  115. }
  116. :host .container {
  117. position: relative;
  118. display: flex;
  119. flex-grow: 1;
  120. cursor: pointer;
  121. flex-direction: column;
  122. border-width: 0px;
  123. border-top-width: 2px;
  124. border-style: solid;
  125. border-color: var(--calcite-ui-border-3);
  126. color: var(--calcite-ui-text-3);
  127. -webkit-text-decoration-line: none;
  128. text-decoration-line: none;
  129. outline: 2px solid transparent;
  130. outline-offset: 2px;
  131. transition-duration: 150ms;
  132. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  133. }
  134. :host {
  135. outline-offset: 0;
  136. outline-color: transparent;
  137. transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
  138. }
  139. :host(:focus) {
  140. outline: 2px solid var(--calcite-ui-brand);
  141. outline-offset: 2px;
  142. }
  143. :host .stepper-item-header {
  144. display: flex;
  145. cursor: pointer;
  146. align-items: flex-start;
  147. }
  148. :host .stepper-item-content, :host .stepper-item-header {
  149. transition-duration: 150ms;
  150. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  151. padding-block: var(--calcite-stepper-item-spacing-unit-l);
  152. padding-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  153. text-align: start;
  154. }
  155. :host .stepper-item-header * {
  156. display: inline-flex;
  157. align-items: center;
  158. transition-duration: 150ms;
  159. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  160. }
  161. :host .stepper-item-content {
  162. display: none;
  163. width: 100%;
  164. flex-direction: column;
  165. font-size: var(--calcite-font-size--2);
  166. line-height: 1.375;
  167. }
  168. :host .stepper-item-icon {
  169. margin-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  170. margin-top: 1px;
  171. display: inline-flex;
  172. height: 0.75rem;
  173. flex-shrink: 0;
  174. align-self: flex-start;
  175. color: var(--calcite-ui-text-3);
  176. opacity: var(--calcite-ui-opacity-disabled);
  177. transition-duration: 150ms;
  178. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  179. }
  180. :host .stepper-item-header-text {
  181. flex-direction: column;
  182. text-align: initial;
  183. margin-inline-end: auto;
  184. }
  185. :host .stepper-item-title, :host .stepper-item-subtitle {
  186. display: flex;
  187. width: 100%;
  188. }
  189. :host .stepper-item-title {
  190. margin-bottom: 0.25rem;
  191. font-weight: var(--calcite-font-weight-medium);
  192. color: var(--calcite-ui-text-2);
  193. }
  194. :host .stepper-item-subtitle {
  195. color: var(--calcite-ui-text-3);
  196. }
  197. :host .stepper-item-number {
  198. font-weight: var(--calcite-font-weight-medium);
  199. color: var(--calcite-ui-text-3);
  200. transition-duration: 150ms;
  201. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  202. margin-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  203. }
  204. :host([disabled]) {
  205. pointer-events: none;
  206. cursor: default;
  207. -webkit-user-select: none;
  208. user-select: none;
  209. opacity: var(--calcite-ui-opacity-disabled);
  210. }
  211. :host([disabled]) ::slotted([calcite-hydrated][disabled]),
  212. :host([disabled]) [calcite-hydrated][disabled] {
  213. /* prevent opacity stacking */
  214. opacity: 1;
  215. }
  216. :host([complete]) .container {
  217. border-color: rgba(0, 122, 194, 0.5);
  218. }
  219. :host([complete]) .container .stepper-item-icon {
  220. color: var(--calcite-ui-brand);
  221. }
  222. :host([error]) .container {
  223. border-top-color: var(--calcite-ui-danger);
  224. }
  225. :host([error]) .container .stepper-item-number {
  226. color: var(--calcite-ui-danger);
  227. }
  228. :host([error]) .container .stepper-item-icon {
  229. opacity: 1;
  230. color: var(--calcite-ui-danger);
  231. }
  232. :host(:hover:not([disabled]):not([active])) .container, :host(:focus:not([disabled]):not([active])) .container {
  233. border-top-color: var(--calcite-ui-brand);
  234. }
  235. :host(:hover:not([disabled]):not([active])) .container .stepper-item-title, :host(:focus:not([disabled]):not([active])) .container .stepper-item-title {
  236. color: var(--calcite-ui-text-1);
  237. }
  238. :host(:hover:not([disabled]):not([active])) .container .stepper-item-subtitle, :host(:focus:not([disabled]):not([active])) .container .stepper-item-subtitle {
  239. color: var(--calcite-ui-text-2);
  240. }
  241. :host([error]:hover:not([disabled]):not([active])) .container, :host([error]:focus:not([disabled]):not([active])) .container {
  242. border-top-color: var(--calcite-ui-danger-hover);
  243. }
  244. :host([active]) .container {
  245. border-top-color: var(--calcite-ui-brand);
  246. }
  247. :host([active]) .container .stepper-item-title {
  248. color: var(--calcite-ui-text-1);
  249. }
  250. :host([active]) .container .stepper-item-subtitle {
  251. color: var(--calcite-ui-text-2);
  252. }
  253. :host([active]) .container .stepper-item-number {
  254. color: var(--calcite-ui-brand);
  255. }
  256. :host([active]) .container .stepper-item-icon {
  257. color: var(--calcite-ui-brand);
  258. opacity: 1;
  259. }
  260. :host([layout=vertical]) .container {
  261. margin-left: 0px;
  262. margin-right: 0px;
  263. margin-top: 0px;
  264. flex: 1 1 auto;
  265. border-top-width: 0px;
  266. border-style: solid;
  267. border-color: var(--calcite-ui-border-3);
  268. padding-top: 0px;
  269. padding-bottom: 0px;
  270. border-inline-start-width: 2px;
  271. padding-inline-start: var(--calcite-stepper-item-spacing-unit-l);
  272. }
  273. :host([layout=vertical]) .container .stepper-item-icon {
  274. order: 3;
  275. margin-top: 1px;
  276. margin-bottom: 0px;
  277. padding-inline-start: var(--calcite-stepper-item-spacing-unit-s);
  278. margin-inline-start: auto;
  279. }
  280. :host([layout=vertical]) .container .stepper-item-header {
  281. padding-inline-end: 0px;
  282. }
  283. :host([layout=vertical]) .container .stepper-item-content {
  284. padding: 0px;
  285. }
  286. :host([layout=vertical][active]) .container .stepper-item-content {
  287. display: flex;
  288. }
  289. :host([layout=vertical][active]) .container .stepper-item-content ::slotted(:last-child) {
  290. margin-bottom: var(--calcite-stepper-item-spacing-unit-l);
  291. }
  292. :host([layout=vertical][complete]) .container {
  293. border-color: rgba(0, 122, 194, 0.5);
  294. }
  295. :host([layout=vertical][complete]:hover:not([disabled]):not([active])) .container, :host([layout=vertical][complete]:focus:not([disabled]):not([active])) .container {
  296. border-color: var(--calcite-ui-brand);
  297. }
  298. :host([layout=vertical][error]) .container {
  299. border-color: var(--calcite-ui-danger);
  300. }
  301. :host([layout=vertical][active]) .container {
  302. border-color: var(--calcite-ui-brand);
  303. }
  304. :host([layout=vertical]:hover:not([disabled]):not([active])) .container,
  305. :host([layout=vertical]:focus:not([disabled]):not([active])) .container {
  306. border-color: rgba(0, 122, 194, 0.5);
  307. }
  308. :host([layout=vertical][error]:hover:not([disabled]):not([active])) .container, :host([layout=vertical][error]:focus:not([disabled]):not([active])) .container {
  309. border-color: var(--calcite-ui-danger-hover);
  310. }