_cards.scss 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. .card {
  2. margin-bottom: $card-group-margin;
  3. box-shadow: $card-shadow;
  4. @at-root a#{&} {
  5. color: inherit;
  6. transition: .3s box-shadow;
  7. &:hover {
  8. text-decoration: none;
  9. box-shadow: $card-shadow-hover;
  10. }
  11. }
  12. }
  13. .card-sm {
  14. .card-body {
  15. padding: .75rem;
  16. }
  17. }
  18. .card-group {
  19. margin-bottom: $card-group-margin;
  20. }
  21. .card-inactive {
  22. pointer-events: none;
  23. box-shadow: none;
  24. .card-body {
  25. opacity: .64;
  26. }
  27. }
  28. .card-active {
  29. position: relative;
  30. background-color: rgba($primary, .03);
  31. &::before {
  32. position: absolute;
  33. top: -1px;
  34. right: -1px;
  35. bottom: -1px;
  36. left: -1px;
  37. content: "";
  38. border: 1px solid $primary;
  39. border-radius: inherit;
  40. }
  41. }
  42. .card-link {
  43. color: inherit;
  44. &:hover {
  45. color: inherit;
  46. text-decoration: none;
  47. box-shadow: 0 1px 6px 0 rgba(0, 0, 0, .08);
  48. }
  49. }
  50. .card-btn {
  51. padding: $card-spacer-y $card-spacer-x;
  52. text-align: center;
  53. background: rgba($primary, .02);
  54. transition: .3s background;
  55. &:hover {
  56. text-decoration: none;
  57. background: rgba($primary, .06);
  58. }
  59. }
  60. .card-stacked {
  61. position: relative;
  62. &::after {
  63. position: absolute;
  64. top: -5px;
  65. right: 5px;
  66. left: 5px;
  67. height: 5px;
  68. content: "";
  69. background: $card-bg;
  70. border: 1px solid $card-border-color;
  71. border-radius: $card-border-radius $card-border-radius 0 0;
  72. }
  73. }
  74. .card-cover {
  75. position: relative;
  76. padding: $card-spacer-y $card-spacer-x;
  77. background: #666666 no-repeat center/cover;
  78. &::before {
  79. position: absolute;
  80. top: 0;
  81. right: 0;
  82. bottom: 0;
  83. left: 0;
  84. content: "";
  85. background: $light-black;
  86. }
  87. &:first-child,
  88. &:first-child::before {
  89. border-radius: $border-radius $border-radius 0 0;
  90. }
  91. }
  92. .card-cover-blurred {
  93. &::before {
  94. backdrop-filter: blur(2px);
  95. }
  96. }
  97. .card-header {
  98. display: flex;
  99. align-items: center;
  100. background: transparent;
  101. }
  102. .card-header-tabs {
  103. flex: 1;
  104. margin: (- $card-spacer-y) (- $card-spacer-x);
  105. }
  106. .card-header-pills {
  107. flex: 1;
  108. }
  109. .card-footer {
  110. color: $text-muted;
  111. }
  112. .card-progress {
  113. height: .25rem;
  114. &:last-child {
  115. border-radius: 0 0 2px 2px;
  116. }
  117. &:first-child {
  118. border-radius: 2px 2px 0 0;
  119. }
  120. }
  121. .card-meta {
  122. color: $text-muted;
  123. }
  124. .card-title {
  125. display: block;
  126. margin: 0 0 1rem;
  127. font-size: $h3-font-size;
  128. font-weight: $headings-font-weight;
  129. color: $headings-color;
  130. @at-root a#{&}:hover {
  131. color: inherit;
  132. }
  133. .card-header & {
  134. margin: .125rem 0;
  135. }
  136. }
  137. .card-subtitle {
  138. margin-top: -$card-spacer-y;
  139. margin-bottom: $card-spacer-y / 2;
  140. font-size: $small-font-size;
  141. color: $text-muted;
  142. }
  143. .card-body {
  144. > :last-child {
  145. margin-bottom: 0;
  146. }
  147. }
  148. .card-body-scrollable {
  149. overflow: auto;
  150. }
  151. /**
  152. Card optinos
  153. */
  154. .card-options {
  155. top: 1.5rem;
  156. right: .75rem;
  157. display: flex;
  158. margin-left: auto;
  159. }
  160. .card-options-link {
  161. display: inline-block;
  162. min-width: 1rem;
  163. margin-left: .25rem;
  164. color: $text-muted;
  165. }
  166. .card-drop {
  167. line-height: 1;
  168. color: $text-muted;
  169. .icon {
  170. width: 1.5rem;
  171. height: 1.5rem;
  172. stroke-width: 1;
  173. }
  174. }
  175. /**
  176. Card status
  177. */
  178. .card-status-top {
  179. position: absolute;
  180. top: 0;
  181. right: 0;
  182. left: 0;
  183. height: $card-status-size;
  184. border-radius: $card-border-radius $card-border-radius 0 0;
  185. }
  186. .card-status-left {
  187. position: absolute;
  188. right: auto;
  189. bottom: 0;
  190. width: $card-status-size;
  191. height: 100%;
  192. border-radius: $card-border-radius 0 0 $card-border-radius;
  193. }
  194. .card-status-bottom {
  195. position: absolute;
  196. top: initial;
  197. bottom: 0;
  198. width: 100%;
  199. height: $card-status-size;
  200. border-radius: 0 0 $card-border-radius $card-border-radius;
  201. }
  202. /**
  203. Card table
  204. */
  205. .card-table {
  206. margin-bottom: 0;
  207. tr {
  208. &:first-child {
  209. td,
  210. th {
  211. border-top: 0;
  212. }
  213. }
  214. td,
  215. th {
  216. border-top: 1px solid $border-color;
  217. &:first-child {
  218. padding-left: $card-spacer-x;
  219. }
  220. &:last-child {
  221. padding-right: $card-spacer-x;
  222. }
  223. }
  224. }
  225. .card-body + & {
  226. border-top: 1px solid $border-color;
  227. }
  228. }
  229. /*
  230. Card code
  231. */
  232. .card-code {
  233. padding: 0;
  234. .highlight {
  235. @extend .highlight-dark;
  236. margin: 0;
  237. border: 0;
  238. }
  239. pre {
  240. margin: 0;
  241. color: #ffffff;
  242. text-shadow: none;
  243. background: transparent;
  244. }
  245. }
  246. /*
  247. Card chart
  248. */
  249. .card-chart {
  250. position: relative;
  251. z-index: 1;
  252. height: 3.5rem;
  253. }
  254. /*
  255. Card profile
  256. */
  257. .card-profile {
  258. .card-header {
  259. height: 9rem;
  260. background-size: cover;
  261. }
  262. }
  263. .card-profile-img {
  264. max-width: 6rem;
  265. margin-top: -5rem;
  266. margin-bottom: 1rem;
  267. border: 3px solid #ffffff;
  268. border-radius: 100%;
  269. box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
  270. }
  271. /*
  272. Card list group
  273. */
  274. .card-list-group {
  275. .card-body + & {
  276. border-top: 1px solid $border-color;
  277. }
  278. .list-group-item {
  279. padding-right: $card-spacer-x;
  280. padding-left: $card-spacer-x;
  281. border-right: 0;
  282. border-left: 0;
  283. border-radius: 0;
  284. &:last-child {
  285. border-bottom: 0;
  286. }
  287. &:first-child {
  288. border-top: 0;
  289. }
  290. }
  291. }
  292. /**
  293. Card tabs
  294. */
  295. .card-tabs {
  296. margin-bottom: $card-group-margin;
  297. .nav-tabs {
  298. position: relative;
  299. z-index: $zindex-dropdown;
  300. border-bottom: 0;
  301. .nav-link {
  302. background: $card-cap-bg;
  303. border: $card-border-width solid $card-border-color;
  304. border-bottom: 0;
  305. &.active,
  306. &:active,
  307. &:hover {
  308. border-color: $card-border-color;
  309. }
  310. &.active {
  311. color: $headings-color;
  312. background: $card-bg;
  313. }
  314. }
  315. .nav-item {
  316. &:not(:first-child) {
  317. .nav-link {
  318. border-top-left-radius: 0;
  319. }
  320. }
  321. &:not(:last-child) {
  322. .nav-link {
  323. border-top-right-radius: 0;
  324. }
  325. }
  326. + .nav-item {
  327. margin-left: -1px;
  328. }
  329. }
  330. }
  331. .nav-tabs-bottom {
  332. margin-bottom: 0;
  333. .nav-item {
  334. margin-top: -1px;
  335. margin-bottom: 0;
  336. .nav-link {
  337. border-top-width: 0;
  338. border-bottom: $card-border-width solid $card-border-color;
  339. border-top-left-radius: 0;
  340. border-top-right-radius: 0;
  341. }
  342. }
  343. }
  344. .card {
  345. margin: 0;
  346. border-top-left-radius: 0;
  347. }
  348. }