_cards.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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. .nav,
  92. .pagination {
  93. margin-bottom: -$card-spacer-y / 2;
  94. margin-top: -$card-spacer-y / 2;
  95. }
  96. [data-toggle='tooltip'] {
  97. position: relative;
  98. }
  99. }
  100. }
  101. .card-title {
  102. float: left;
  103. font-size: $card-title-font-size;
  104. font-weight: $card-title-font-weight;
  105. margin: 0;
  106. }
  107. .card-text {
  108. clear: both;
  109. }
  110. // Box Tools Buttons
  111. .btn-tool {
  112. background: transparent;
  113. color: $gray-500;
  114. font-size: $font-size-sm;
  115. margin: -(($card-spacer-y / 2) * 2) 0;
  116. padding: .25rem .5rem;
  117. .btn-group.show &,
  118. &:hover {
  119. color: $gray-700;
  120. }
  121. .show &,
  122. &:focus {
  123. box-shadow: none !important;
  124. }
  125. }
  126. .text-sm {
  127. .card-title {
  128. font-size: $card-title-font-size-sm;
  129. }
  130. .nav-link {
  131. padding: $card-nav-link-padding-sm-y $card-nav-link-padding-sm-x;
  132. }
  133. }
  134. // Box Body
  135. .card-body {
  136. // @include border-radius-sides(0, 0, $border-radius, $border-radius);
  137. // .no-header & {
  138. // @include border-top-radius($border-radius);
  139. // }
  140. // Tables within the box body
  141. > .table {
  142. margin-bottom: 0;
  143. > thead > tr > th,
  144. > thead > tr > td {
  145. border-top-width: 0;
  146. }
  147. }
  148. // Calendar within the box body
  149. .fc {
  150. margin-top: 5px;
  151. }
  152. .full-width-chart {
  153. margin: -19px;
  154. }
  155. &.p-0 .full-width-chart {
  156. margin: -9px;
  157. }
  158. }
  159. .chart-legend {
  160. @extend .list-unstyled;
  161. margin: 10px 0;
  162. > li {
  163. @media (max-width: map-get($grid-breakpoints, sm)) {
  164. float: left;
  165. margin-right: 10px;
  166. }
  167. }
  168. }
  169. // Comment Box
  170. .card-comments {
  171. background: $gray-100;
  172. .card-comment {
  173. @include clearfix;
  174. border-bottom: 1px solid $gray-200;
  175. padding: 8px 0;
  176. &:last-of-type {
  177. border-bottom: 0;
  178. }
  179. &:first-of-type {
  180. padding-top: 0;
  181. }
  182. img {
  183. @extend .img-sm;
  184. float: left;
  185. }
  186. }
  187. .comment-text {
  188. color: lighten($gray-700, 20%);
  189. margin-left: 40px;
  190. }
  191. .username {
  192. color: $gray-700;
  193. display: block;
  194. font-weight: 600;
  195. }
  196. .text-muted {
  197. font-size: 12px;
  198. font-weight: 400;
  199. }
  200. }
  201. // Widgets
  202. //-----------
  203. // Widget: TODO LIST
  204. .todo-list {
  205. list-style: none;
  206. margin: 0;
  207. overflow: auto;
  208. padding: 0;
  209. // Todo list element
  210. > li {
  211. @include border-radius(2px);
  212. background: $gray-100;
  213. border-left: 2px solid $gray-200;
  214. color: $gray-700;
  215. margin-bottom: 2px;
  216. padding: 10px;
  217. &:last-of-type {
  218. margin-bottom: 0;
  219. }
  220. > input[type='checkbox'] {
  221. margin: 0 10px 0 5px;
  222. }
  223. .text {
  224. display: inline-block;
  225. font-weight: 600;
  226. margin-left: 5px;
  227. }
  228. // Time labels
  229. .badge {
  230. font-size: .7rem;
  231. margin-left: 10px;
  232. }
  233. // Tools and options box
  234. .tools {
  235. color: theme-color('danger');
  236. display: none;
  237. float: right;
  238. // icons
  239. > .fa,
  240. > .fas,
  241. > .far,
  242. > .fab,
  243. > .glyphicon,
  244. > .ion {
  245. cursor: pointer;
  246. margin-right: 5px;
  247. }
  248. }
  249. &:hover .tools {
  250. display: inline-block;
  251. }
  252. &.done {
  253. color: darken($gray-500, 25%);
  254. .text {
  255. font-weight: 500;
  256. text-decoration: line-through;
  257. }
  258. .badge {
  259. background: $gray-500 !important;
  260. }
  261. }
  262. }
  263. // Color variants
  264. @each $name, $color in $theme-colors {
  265. .#{$name} {
  266. border-left-color: $color;
  267. }
  268. }
  269. @each $name, $color in $colors {
  270. .#{$name} {
  271. border-left-color: $color;
  272. }
  273. }
  274. .handle {
  275. cursor: move;
  276. display: inline-block;
  277. margin: 0 5px;
  278. }
  279. }
  280. // END TODO WIDGET
  281. // Input in box
  282. .card-input {
  283. max-width: 200px;
  284. }
  285. // Color variants
  286. @each $name, $color in $theme-colors {
  287. @include cards-variant($name, $color);
  288. }
  289. @each $name, $color in $colors {
  290. @include cards-variant($name, $color);
  291. }