_cards.scss 7.3 KB

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