_cards.scss 8.8 KB

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