_cards.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. //
  2. // Component: Cards
  3. //
  4. // Color variants
  5. @each $name, $color in $theme-colors {
  6. @include cards-variant($name, $color);
  7. }
  8. @each $name, $color in $colors {
  9. @include cards-variant($name, $color);
  10. }
  11. .card {
  12. @include box-shadow($card-shadow);
  13. margin-bottom: map-get($spacers, 3);
  14. &.bg-dark {
  15. .card-header {
  16. border-color: $card-dark-border-color;
  17. }
  18. &,
  19. .card-body {
  20. color: $white;
  21. }
  22. }
  23. &.maximized-card {
  24. height: 100% !important;
  25. left: 0;
  26. max-height: 100% !important;
  27. max-width: 100% !important;
  28. position: fixed;
  29. top: 0;
  30. width: 100% !important;
  31. z-index: 9999;
  32. &.was-collapsed .card-body {
  33. display: block !important;
  34. }
  35. [data-widget="collapse"] {
  36. display: none;
  37. }
  38. .card-header,
  39. .card-footer {
  40. @include border-radius(0 !important);
  41. }
  42. }
  43. // collapsed mode
  44. &.collapsed-card {
  45. .card-body,
  46. .card-footer {
  47. display: none;
  48. }
  49. }
  50. .nav.flex-column {
  51. > li {
  52. border-bottom: 1px solid $card-border-color;
  53. margin: 0;
  54. &:last-of-type {
  55. border-bottom: 0;
  56. }
  57. }
  58. }
  59. // fixed height to 300px
  60. &.height-control {
  61. .card-body {
  62. max-height: 300px;
  63. overflow: auto;
  64. }
  65. }
  66. .border-right {
  67. border-right: 1px solid $card-border-color;
  68. }
  69. .border-left {
  70. border-left: 1px solid $card-border-color;
  71. }
  72. &.card-tabs {
  73. &:not(.card-outline) {
  74. & > .card-header {
  75. border-bottom: 0;
  76. .nav-item {
  77. &:first-child .nav-link {
  78. margin-left: -1px;
  79. }
  80. }
  81. }
  82. }
  83. &.card-outline {
  84. .nav-item {
  85. border-bottom: 0;
  86. &:first-child .nav-link {
  87. border-left: 0;
  88. margin-left: 0;
  89. }
  90. }
  91. }
  92. .card-tools {
  93. margin: .3rem .5rem;
  94. }
  95. &:not(.expanding-card).collapsed-card {
  96. .card-header {
  97. border-bottom: 0;
  98. .nav-tabs {
  99. border-bottom: 0;
  100. .nav-item {
  101. margin-bottom: 0;
  102. }
  103. }
  104. }
  105. }
  106. &.expanding-card {
  107. .card-header {
  108. .nav-tabs {
  109. .nav-item {
  110. margin-bottom: -1px;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. &.card-outline-tabs {
  117. border-top: 0;
  118. .card-header {
  119. .nav-item {
  120. &:first-child .nav-link {
  121. border-left: 0;
  122. margin-left: 0;
  123. }
  124. }
  125. a {
  126. border-top: 3px solid transparent;
  127. &:hover {
  128. border-top: 3px solid $nav-tabs-border-color;
  129. }
  130. &.active {
  131. &:hover {
  132. margin-top: 0;
  133. }
  134. }
  135. }
  136. }
  137. .card-tools {
  138. margin: .5rem .5rem .3rem;
  139. }
  140. &:not(.expanding-card).collapsed-card .card-header {
  141. border-bottom: 0;
  142. .nav-tabs {
  143. border-bottom: 0;
  144. .nav-item {
  145. margin-bottom: 0;
  146. }
  147. }
  148. }
  149. &.expanding-card {
  150. .card-header {
  151. .nav-tabs {
  152. .nav-item {
  153. margin-bottom: -1px;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. // Maximized Card Body Scroll fix
  161. html.maximized-card {
  162. overflow: hidden;
  163. }
  164. // Add clearfix to header, body and footer
  165. .card-header,
  166. .card-body,
  167. .card-footer {
  168. @include clearfix ();
  169. }
  170. // Box header
  171. .card-header {
  172. background-color: transparent;
  173. border-bottom: 1px solid $card-border-color;
  174. padding: (($card-spacer-y / 2) * 2) $card-spacer-x;
  175. position: relative;
  176. @if $enable-rounded {
  177. @include border-top-radius($border-radius);
  178. }
  179. .collapsed-card & {
  180. border-bottom: 0;
  181. }
  182. > .card-tools {
  183. float: right;
  184. margin-right: -$card-spacer-x / 2;
  185. .input-group,
  186. .nav,
  187. .pagination {
  188. margin-bottom: -$card-spacer-y / 2.5;
  189. margin-top: -$card-spacer-y / 2.5;
  190. }
  191. [data-toggle="tooltip"] {
  192. position: relative;
  193. }
  194. }
  195. }
  196. .card-title {
  197. float: left;
  198. font-size: $card-title-font-size;
  199. font-weight: $card-title-font-weight;
  200. margin: 0;
  201. }
  202. .card-text {
  203. clear: both;
  204. }
  205. // Box Tools Buttons
  206. .btn-tool {
  207. background: transparent;
  208. color: $gray-500;
  209. font-size: $font-size-sm;
  210. margin: -(($card-spacer-y / 2) * 2) 0;
  211. padding: .25rem .5rem;
  212. .btn-group.show &,
  213. &:hover {
  214. color: $gray-700;
  215. }
  216. .show &,
  217. &:focus {
  218. box-shadow: none !important;
  219. }
  220. }
  221. .text-sm {
  222. .card-title {
  223. font-size: $card-title-font-size-sm;
  224. }
  225. .nav-link {
  226. padding: $card-nav-link-padding-sm-y $card-nav-link-padding-sm-x;
  227. }
  228. }
  229. // Box Body
  230. .card-body {
  231. // @include border-radius-sides(0, 0, $border-radius, $border-radius);
  232. // .no-header & {
  233. // @include border-top-radius($border-radius);
  234. // }
  235. // Tables within the box body
  236. > .table {
  237. margin-bottom: 0;
  238. > thead > tr > th,
  239. > thead > tr > td {
  240. border-top-width: 0;
  241. }
  242. }
  243. // Calendar within the box body
  244. .fc {
  245. margin-top: 5px;
  246. }
  247. .full-width-chart {
  248. margin: -19px;
  249. }
  250. &.p-0 .full-width-chart {
  251. margin: -9px;
  252. }
  253. }
  254. .chart-legend {
  255. @include list-unstyled ();
  256. margin: 10px 0;
  257. > li {
  258. @media (max-width: map-get($grid-breakpoints, sm)) {
  259. float: left;
  260. margin-right: 10px;
  261. }
  262. }
  263. }
  264. // Comment Box
  265. .card-comments {
  266. background: $gray-100;
  267. .card-comment {
  268. @include clearfix ();
  269. border-bottom: 1px solid $gray-200;
  270. padding: 8px 0;
  271. &:last-of-type {
  272. border-bottom: 0;
  273. }
  274. &:first-of-type {
  275. padding-top: 0;
  276. }
  277. img {
  278. height: $card-img-size;
  279. width: $card-img-size;
  280. float: left;
  281. }
  282. }
  283. .comment-text {
  284. color: lighten($gray-700, 20%);
  285. margin-left: 40px;
  286. }
  287. .username {
  288. color: $gray-700;
  289. display: block;
  290. font-weight: 600;
  291. }
  292. .text-muted {
  293. font-size: 12px;
  294. font-weight: 400;
  295. }
  296. }
  297. // Widgets
  298. //-----------
  299. // Widget: TODO LIST
  300. .todo-list {
  301. list-style: none;
  302. margin: 0;
  303. overflow: auto;
  304. padding: 0;
  305. // Todo list element
  306. > li {
  307. @include border-radius(2px);
  308. background: $gray-100;
  309. border-left: 2px solid $gray-200;
  310. color: $gray-700;
  311. margin-bottom: 2px;
  312. padding: 10px;
  313. &:last-of-type {
  314. margin-bottom: 0;
  315. }
  316. > input[type="checkbox"] {
  317. margin: 0 10px 0 5px;
  318. }
  319. .text {
  320. display: inline-block;
  321. font-weight: 600;
  322. margin-left: 5px;
  323. }
  324. // Time labels
  325. .badge {
  326. font-size: .7rem;
  327. margin-left: 10px;
  328. }
  329. // Tools and options box
  330. .tools {
  331. color: theme-color("danger");
  332. display: none;
  333. float: right;
  334. // icons
  335. > .fa,
  336. > .fas,
  337. > .far,
  338. > .fab,
  339. > .ion {
  340. cursor: pointer;
  341. margin-right: 5px;
  342. }
  343. }
  344. &:hover .tools {
  345. display: inline-block;
  346. }
  347. &.done {
  348. color: darken($gray-500, 25%);
  349. .text {
  350. font-weight: 500;
  351. text-decoration: line-through;
  352. }
  353. .badge {
  354. background: $gray-500 !important;
  355. }
  356. }
  357. }
  358. // Color variants
  359. @each $name, $color in $theme-colors {
  360. .#{$name} {
  361. border-left-color: $color;
  362. }
  363. }
  364. @each $name, $color in $colors {
  365. .#{$name} {
  366. border-left-color: $color;
  367. }
  368. }
  369. .handle {
  370. cursor: move;
  371. display: inline-block;
  372. margin: 0 5px;
  373. }
  374. }
  375. // END TODO WIDGET
  376. // Input in box
  377. .card-input {
  378. max-width: 200px;
  379. }
  380. // Nav Tabs override
  381. .card-default {
  382. .nav-item {
  383. &:first-child .nav-link {
  384. border-left: 0;
  385. }
  386. }
  387. }