_cards.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. .card {
  2. @include transition(transform $transition-time ease-out, opacity $transition-time ease-out, box-shadow $transition-time ease-out);
  3. @media print {
  4. border: none;
  5. box-shadow: none;
  6. }
  7. @at-root a#{&} {
  8. color: inherit;
  9. &:hover {
  10. text-decoration: none;
  11. box-shadow: $box-shadow-card-hover;
  12. }
  13. }
  14. .card {
  15. box-shadow: none;
  16. }
  17. }
  18. // Card borderless
  19. .card-borderless {
  20. &,
  21. .card-header,
  22. .card-footer {
  23. border-color: transparent;
  24. }
  25. }
  26. // Card stamp
  27. .card-stamp {
  28. --#{$prefix}stamp-size: 7rem;
  29. position: absolute;
  30. top: 0;
  31. right: 0;
  32. width: calc(var(--#{$prefix}stamp-size) * 1);
  33. height: calc(var(--#{$prefix}stamp-size) * 1);
  34. max-height: 100%;
  35. border-top-right-radius: $border-radius;
  36. opacity: $card-stamp-opacity;
  37. overflow: hidden;
  38. pointer-events: none;
  39. }
  40. .card-stamp-lg {
  41. --#{$prefix}stamp-size: 13rem;
  42. }
  43. .card-stamp-icon {
  44. background: var(--#{$prefix}secondary);
  45. color: var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  46. display: flex;
  47. align-items: center;
  48. justify-content: center;
  49. border-radius: $border-radius-pill;
  50. width: calc(var(--#{$prefix}stamp-size) * 1);
  51. height: calc(var(--#{$prefix}stamp-size) * 1);
  52. position: relative;
  53. top: calc(var(--#{$prefix}stamp-size) * -.25);
  54. right: calc(var(--#{$prefix}stamp-size) * -.25);
  55. font-size: calc(var(--#{$prefix}stamp-size) * .75);
  56. transform: rotate(10deg);
  57. .icon {
  58. stroke-width: 2;
  59. width: calc(var(--#{$prefix}stamp-size) * .75);
  60. height: calc(var(--#{$prefix}stamp-size) * .75);
  61. }
  62. }
  63. // Card image
  64. .card-img,
  65. .card-img-start {
  66. @include border-start-radius($card-inner-border-radius);
  67. }
  68. .card-img,
  69. .card-img-end {
  70. @include border-end-radius($card-inner-border-radius);
  71. }
  72. .card-img-overlay {
  73. display: flex;
  74. flex-direction: column;
  75. justify-content: flex-end;
  76. }
  77. .card-img-overlay-dark {
  78. background-image: $overlay-gradient;
  79. }
  80. .card-inactive {
  81. pointer-events: none;
  82. box-shadow: none;
  83. .card-body {
  84. opacity: .64;
  85. }
  86. }
  87. .card-active {
  88. --#{$prefix}card-border-color: var(--#{$prefix}primary);
  89. --#{$prefix}card-bg: var(--#{$prefix}active-bg);
  90. }
  91. .card-btn {
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. padding: $card-spacer-y $card-spacer-x;
  96. text-align: center;
  97. @include transition(background $transition-time);
  98. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  99. flex: 1;
  100. color: inherit;
  101. font-weight: var(--#{$prefix}font-weight-medium);
  102. &:hover {
  103. text-decoration: none;
  104. background: $active-bg;
  105. }
  106. & + & {
  107. border-left: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  108. }
  109. }
  110. /**
  111. Stacked card
  112. */
  113. .card-stacked {
  114. --#{$prefix}card-stacked-offset: .25rem;
  115. position: relative;
  116. &:after {
  117. position: absolute;
  118. top: calc(-1 * var(--#{$prefix}card-stacked-offset));
  119. right: var(--#{$prefix}card-stacked-offset);
  120. left: var(--#{$prefix}card-stacked-offset);
  121. height: var(--#{$prefix}card-stacked-offset);
  122. content: "";
  123. background: var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  124. border: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}card-border-color);
  125. border-radius: var(--#{$prefix}card-border-radius) var(--#{$prefix}card-border-radius) 0 0;
  126. }
  127. }
  128. .card-cover {
  129. position: relative;
  130. padding: $card-spacer-y $card-spacer-x;
  131. background: #666666 no-repeat center/cover;
  132. &:before {
  133. position: absolute;
  134. top: 0;
  135. right: 0;
  136. bottom: 0;
  137. left: 0;
  138. content: "";
  139. background: rgba($dark, .48);
  140. }
  141. &:first-child,
  142. &:first-child:before {
  143. border-radius: $border-radius $border-radius 0 0;
  144. }
  145. }
  146. .card-cover-blurred {
  147. &:before {
  148. backdrop-filter: blur(2px);
  149. }
  150. }
  151. .card-actions {
  152. margin: -.5rem -.5rem -.5rem auto;
  153. padding-left: .5rem;
  154. a {
  155. text-decoration: none;
  156. }
  157. }
  158. // Card header
  159. .card-header {
  160. color: inherit;
  161. display: flex;
  162. align-items: center;
  163. background: transparent;
  164. &:first-child {
  165. border-radius: var(--#{$prefix}card-border-radius) var(--#{$prefix}card-border-radius) 0 0;
  166. }
  167. }
  168. .card-header-light {
  169. border-bottom-color: transparent;
  170. background: var(--#{$prefix}bg-surface-tertiary);
  171. }
  172. .card-header-tabs {
  173. background: $card-header-tabs-bg;
  174. flex: 1;
  175. margin: calc(var(--#{$prefix}card-cap-padding-y) * -1) calc(var(--#{$prefix}card-cap-padding-x) * -1) calc(var(--#{$prefix}card-cap-padding-y) * -1);
  176. padding: calc(var(--#{$prefix}card-cap-padding-y) * .5) calc(var(--#{$prefix}card-cap-padding-x) * .5) 0;
  177. }
  178. .card-header-pills {
  179. flex: 1;
  180. margin-top: -.5rem;
  181. margin-bottom: -.5rem;
  182. }
  183. // Card rotate
  184. .card-rotate-left {
  185. transform: rotate(-1.5deg);
  186. }
  187. .card-rotate-right {
  188. transform: rotate(1.5deg);
  189. }
  190. // Card link
  191. .card-link {
  192. color: inherit;
  193. &:hover {
  194. color: inherit;
  195. text-decoration: none;
  196. box-shadow: 0 1px 6px 0 rgba(0, 0, 0, .08);
  197. }
  198. }
  199. .card-link-rotate:hover {
  200. transform: rotate(1.5deg);
  201. opacity: 1
  202. }
  203. .card-link-pop:hover {
  204. transform: translateY(-2px);
  205. opacity: 1
  206. }
  207. // Card footer
  208. .card-footer {
  209. margin-top: auto;
  210. &:last-child {
  211. border-radius: 0 0 var(--#{$prefix}card-border-radius) var(--#{$prefix}card-border-radius);
  212. }
  213. }
  214. .card-footer-transparent {
  215. background: transparent;
  216. border-color: transparent;
  217. padding-top: 0;
  218. }
  219. .card-footer-borderless {
  220. border-top: none;
  221. }
  222. // Card progress
  223. .card-progress {
  224. height: .25rem;
  225. &:last-child {
  226. border-radius: 0 0 2px 2px;
  227. }
  228. &:first-child {
  229. border-radius: 2px 2px 0 0;
  230. }
  231. }
  232. .card-meta {
  233. color: var(--#{$prefix}secondary);
  234. }
  235. .card-title {
  236. display: block;
  237. margin: 0 0 1rem;
  238. font-size: $h3-font-size;
  239. font-weight: var(--#{$prefix}font-weight-medium);
  240. color: $headings-color;
  241. line-height: 1.5rem;
  242. @at-root a#{&}:hover {
  243. color: inherit;
  244. }
  245. .card-header & {
  246. margin: 0;
  247. }
  248. }
  249. .card-subtitle {
  250. margin-bottom: $card-title-spacer-y;
  251. color: var(--#{$prefix}secondary);
  252. font-weight: normal;
  253. .card-header & {
  254. margin: 0;
  255. }
  256. .card-title & {
  257. margin: 0 0 0 .25rem;
  258. font-size: $h4-font-size;
  259. }
  260. }
  261. .card-body {
  262. position: relative;
  263. > :last-child {
  264. margin-bottom: 0;
  265. }
  266. .card-sm > & {
  267. padding: 1rem;
  268. }
  269. .card-md > & {
  270. @include media-breakpoint-up(md) {
  271. padding: 2.5rem;
  272. }
  273. }
  274. .card-lg > & {
  275. @include media-breakpoint-up(md) {
  276. padding: 2rem;
  277. }
  278. @include media-breakpoint-up(lg) {
  279. padding: 4rem;
  280. }
  281. }
  282. @media print {
  283. padding: 0;
  284. }
  285. & + & {
  286. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  287. }
  288. }
  289. .card-body-scrollable {
  290. overflow: auto;
  291. }
  292. /**
  293. Card optinos
  294. */
  295. .card-options {
  296. top: 1.5rem;
  297. right: .75rem;
  298. display: flex;
  299. margin-left: auto;
  300. }
  301. .card-options-link {
  302. display: inline-block;
  303. min-width: 1rem;
  304. margin-left: .25rem;
  305. color: var(--#{$prefix}secondary);
  306. }
  307. /**
  308. Card status
  309. */
  310. .card-status-top {
  311. position: absolute;
  312. top: 0;
  313. right: 0;
  314. left: 0;
  315. height: $card-status-size;
  316. border-radius: var(--#{$prefix}card-border-radius) var(--#{$prefix}card-border-radius) 0 0;
  317. }
  318. .card-status-start {
  319. position: absolute;
  320. right: auto;
  321. bottom: 0;
  322. width: $card-status-size;
  323. height: 100%;
  324. border-radius: var(--#{$prefix}card-border-radius) 0 0 var(--#{$prefix}card-border-radius);
  325. }
  326. .card-status-bottom {
  327. position: absolute;
  328. top: initial;
  329. bottom: 0;
  330. width: 100%;
  331. height: $card-status-size;
  332. border-radius: 0 0 var(--#{$prefix}card-border-radius) var(--#{$prefix}card-border-radius);
  333. }
  334. /**
  335. Card table
  336. */
  337. .card-table {
  338. margin-bottom: 0 !important;
  339. border-bottom-width: 0;
  340. tr {
  341. td,
  342. th {
  343. &:first-child {
  344. padding-left: $card-spacer-x;
  345. border-left-width: 0;
  346. }
  347. &:last-child {
  348. padding-right: $card-spacer-x;
  349. border-right-width: 0;
  350. }
  351. }
  352. }
  353. thead,
  354. tbody,
  355. tfoot {
  356. tr {
  357. &:first-child {
  358. border-top-width: 0;
  359. td,
  360. th {
  361. border-top-width: 0;
  362. }
  363. }
  364. &:last-child {
  365. border-bottom-width: 0;
  366. td,
  367. th {
  368. border-bottom-width: 0;
  369. }
  370. }
  371. }
  372. }
  373. .card-body + & {
  374. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}table-border-color);
  375. }
  376. }
  377. /*
  378. Card code
  379. */
  380. .card-code {
  381. padding: 0;
  382. .highlight {
  383. margin: 0;
  384. border: 0;
  385. }
  386. pre {
  387. margin: 0 !important;
  388. border: 0 !important;
  389. }
  390. }
  391. /*
  392. Card chart
  393. */
  394. .card-chart {
  395. position: relative;
  396. z-index: 1;
  397. height: 3.5rem;
  398. }
  399. /**
  400. Card avatar
  401. */
  402. .card-avatar {
  403. margin-left: auto;
  404. margin-right: auto;
  405. box-shadow: 0 0 0 .25rem var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  406. margin-top: calc(-1 * calc(var(--#{$prefix}avatar-size) * .5));
  407. }
  408. /*
  409. Card list group
  410. */
  411. .card-list-group {
  412. .card-body + & {
  413. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  414. }
  415. .list-group-item {
  416. padding-right: $card-spacer-x;
  417. padding-left: $card-spacer-x;
  418. border-right: 0;
  419. border-left: 0;
  420. border-radius: 0;
  421. &:last-child {
  422. border-bottom: 0;
  423. }
  424. &:first-child {
  425. border-top: 0;
  426. }
  427. }
  428. }
  429. // Card tabs
  430. .card-tabs {
  431. .nav-tabs {
  432. position: relative;
  433. z-index: $zindex-dropdown;
  434. border-bottom: 0;
  435. .nav-link {
  436. background: $card-cap-bg;
  437. border: $card-border-width var(--#{$prefix}border-style) $card-border-color;
  438. &.active,
  439. &:active,
  440. &:hover {
  441. border-color: $card-border-color;
  442. color: var(--#{$prefix}body-color);
  443. }
  444. &.active {
  445. color: $headings-color;
  446. background: var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  447. border-bottom-color: transparent;
  448. }
  449. }
  450. .nav-item {
  451. &:not(:first-child) {
  452. .nav-link {
  453. border-top-left-radius: 0;
  454. }
  455. }
  456. &:not(:last-child) {
  457. .nav-link {
  458. border-top-right-radius: 0;
  459. }
  460. }
  461. + .nav-item {
  462. margin-left: calc(-1 * #{$card-border-width});
  463. }
  464. }
  465. }
  466. .nav-tabs-bottom {
  467. margin-bottom: 0;
  468. .nav-link {
  469. margin-bottom: 0;
  470. &.active {
  471. border-top-color: transparent;
  472. }
  473. }
  474. .nav-item {
  475. margin-top: calc(-1 * #{$card-border-width});
  476. margin-bottom: 0;
  477. .nav-link {
  478. border-bottom: $card-border-width var(--#{$prefix}border-style) $card-border-color;
  479. border-radius: 0 0 $card-border-radius $card-border-radius;
  480. }
  481. &:not(:first-child) .nav-link {
  482. border-bottom-left-radius: 0;
  483. }
  484. &:not(:last-child) .nav-link {
  485. border-bottom-right-radius: 0;
  486. }
  487. }
  488. }
  489. .card {
  490. border-bottom-left-radius: 0;
  491. }
  492. .nav-tabs + .tab-content .card {
  493. border-bottom-left-radius: var(--#{$prefix}card-border-radius);
  494. border-top-left-radius: 0;
  495. }
  496. }
  497. /**
  498. Card note
  499. */
  500. .card-note {
  501. --#{$prefix}card-bg: #fff7dd;
  502. --#{$prefix}card-border-color: #fff1c9;
  503. }