_cards.scss 5.6 KB

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