_cards.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  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. tr {
  340. td,
  341. th {
  342. &:first-child {
  343. padding-left: $card-spacer-x;
  344. border-left: 0;
  345. }
  346. &:last-child {
  347. padding-right: $card-spacer-x;
  348. border-right: 0;
  349. }
  350. }
  351. }
  352. thead,
  353. tbody,
  354. tfoot {
  355. tr {
  356. &:first-child {
  357. border-top: 0;
  358. td,
  359. th {
  360. border-top: 0;
  361. }
  362. }
  363. }
  364. }
  365. .card-body + & {
  366. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}table-border-color);
  367. }
  368. }
  369. /*
  370. Card code
  371. */
  372. .card-code {
  373. padding: 0;
  374. .highlight {
  375. margin: 0;
  376. border: 0;
  377. }
  378. pre {
  379. margin: 0 !important;
  380. border: 0 !important;
  381. }
  382. }
  383. /*
  384. Card chart
  385. */
  386. .card-chart {
  387. position: relative;
  388. z-index: 1;
  389. height: 3.5rem;
  390. }
  391. /**
  392. Card avatar
  393. */
  394. .card-avatar {
  395. margin-left: auto;
  396. margin-right: auto;
  397. box-shadow: 0 0 0 .25rem var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  398. margin-top: calc(-1 * calc(var(--#{$prefix}avatar-size) * .5));
  399. }
  400. /*
  401. Card list group
  402. */
  403. .card-list-group {
  404. .card-body + & {
  405. border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  406. }
  407. .list-group-item {
  408. padding-right: $card-spacer-x;
  409. padding-left: $card-spacer-x;
  410. border-right: 0;
  411. border-left: 0;
  412. border-radius: 0;
  413. &:last-child {
  414. border-bottom: 0;
  415. }
  416. &:first-child {
  417. border-top: 0;
  418. }
  419. }
  420. }
  421. // Card tabs
  422. .card-tabs {
  423. .nav-tabs {
  424. position: relative;
  425. z-index: $zindex-dropdown;
  426. border-bottom: 0;
  427. .nav-link {
  428. background: $card-cap-bg;
  429. border: $card-border-width var(--#{$prefix}border-style) $card-border-color;
  430. &.active,
  431. &:active,
  432. &:hover {
  433. border-color: $card-border-color;
  434. color: var(--#{$prefix}body-color);
  435. }
  436. &.active {
  437. color: $headings-color;
  438. background: var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
  439. border-bottom-color: transparent;
  440. }
  441. }
  442. .nav-item {
  443. &:not(:first-child) {
  444. .nav-link {
  445. border-top-left-radius: 0;
  446. }
  447. }
  448. &:not(:last-child) {
  449. .nav-link {
  450. border-top-right-radius: 0;
  451. }
  452. }
  453. + .nav-item {
  454. margin-left: calc(-1 * #{$card-border-width});
  455. }
  456. }
  457. }
  458. .nav-tabs-bottom {
  459. margin-bottom: 0;
  460. .nav-link {
  461. margin-bottom: 0;
  462. &.active {
  463. border-top-color: transparent;
  464. }
  465. }
  466. .nav-item {
  467. margin-top: calc(-1 * #{$card-border-width});
  468. margin-bottom: 0;
  469. .nav-link {
  470. border-bottom: $card-border-width var(--#{$prefix}border-style) $card-border-color;
  471. border-radius: 0 0 $card-border-radius $card-border-radius;
  472. }
  473. &:not(:first-child) .nav-link {
  474. border-bottom-left-radius: 0;
  475. }
  476. &:not(:last-child) .nav-link {
  477. border-bottom-right-radius: 0;
  478. }
  479. }
  480. }
  481. .card {
  482. border-bottom-left-radius: 0;
  483. }
  484. .nav-tabs + .tab-content .card {
  485. border-bottom-left-radius: var(--#{$prefix}card-border-radius);
  486. border-top-left-radius: 0;
  487. }
  488. }
  489. /**
  490. Card note
  491. */
  492. .card-note {
  493. --#{$prefix}card-bg: #fff7dd;
  494. --#{$prefix}card-border-color: #fff1c9;
  495. }