_cards.scss 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. .card-panel {
  2. transition: box-shadow .25s;
  3. padding: $card-padding;
  4. margin: $element-top-margin 0 $element-bottom-margin 0;
  5. border-radius: 2px;
  6. @extend .z-depth-1;
  7. background-color: $card-bg-color;
  8. }
  9. .card {
  10. position: relative;
  11. margin: $element-top-margin 0 $element-bottom-margin 0;
  12. background-color: $card-bg-color;
  13. transition: box-shadow .25s;
  14. border-radius: 2px;
  15. @extend .z-depth-1;
  16. .card-title {
  17. font-size: 24px;
  18. font-weight: 300;
  19. &.activator {
  20. cursor: pointer;
  21. }
  22. }
  23. // Card Sizes
  24. &.small, &.medium, &.large {
  25. position: relative;
  26. .card-image {
  27. max-height: 60%;
  28. overflow: hidden;
  29. }
  30. .card-image + .card-content {
  31. max-height: 40%;
  32. }
  33. .card-content {
  34. max-height: 100%;
  35. overflow: hidden;
  36. }
  37. .card-action {
  38. position: absolute;
  39. bottom: 0;
  40. left: 0;
  41. right: 0;
  42. }
  43. }
  44. &.small {
  45. height: 300px;
  46. }
  47. &.medium {
  48. height: 400px;
  49. }
  50. &.large {
  51. height: 500px;
  52. }
  53. // Horizontal Cards
  54. &.horizontal {
  55. &.small, &.medium, &.large {
  56. .card-image {
  57. height: 100%;
  58. max-height: none;
  59. overflow: visible;
  60. img {
  61. height: 100%;
  62. }
  63. }
  64. }
  65. display: flex;
  66. .card-image {
  67. max-width: 50%;
  68. img {
  69. border-radius: 2px 0 0 2px;
  70. max-width: 100%;
  71. width: auto;
  72. }
  73. }
  74. .card-stacked {
  75. display: flex;
  76. flex-direction: column;
  77. flex: 1;
  78. position: relative;
  79. .card-content {
  80. flex-grow: 1;
  81. }
  82. }
  83. }
  84. // Sticky Action Section
  85. &.sticky-action {
  86. .card-action {
  87. z-index: 2;
  88. }
  89. .card-reveal {
  90. z-index: 1;
  91. padding-bottom: 64px;
  92. }
  93. }
  94. .card-image {
  95. position: relative;
  96. // Image background for content
  97. img {
  98. display: block;
  99. border-radius: 2px 2px 0 0;
  100. position: relative;
  101. left: 0;
  102. right: 0;
  103. top: 0;
  104. bottom: 0;
  105. width: 100%;
  106. }
  107. .card-title {
  108. color: $card-bg-color;
  109. position: absolute;
  110. bottom: 0;
  111. left: 0;
  112. max-width: 100%;
  113. padding: $card-padding;
  114. }
  115. }
  116. .card-content {
  117. padding: $card-padding;
  118. border-radius: 0 0 2px 2px;
  119. p {
  120. margin: 0;
  121. }
  122. .card-title {
  123. display: block;
  124. line-height: 32px;
  125. margin-bottom: 8px;
  126. i {
  127. line-height: 32px;
  128. }
  129. }
  130. }
  131. .card-action {
  132. &:last-child {
  133. border-radius: 0 0 2px 2px;
  134. }
  135. background-color: inherit; // Use inherit to inherit color classes
  136. border-top: 1px solid rgba(160,160,160,.2);
  137. position: relative;
  138. padding: 16px $card-padding;
  139. a:not(.btn):not(.btn-large):not(.btn-floating) {
  140. color: $card-link-color;
  141. margin-right: $card-padding;
  142. transition: color .3s ease;
  143. text-transform: uppercase;
  144. &:hover { color: $card-link-color-light; }
  145. }
  146. }
  147. .card-reveal {
  148. padding: $card-padding;
  149. position: absolute;
  150. background-color: $card-bg-color;
  151. width: 100%;
  152. overflow-y: auto;
  153. left: 0;
  154. top: 100%;
  155. height: 100%;
  156. z-index: 3;
  157. display: none;
  158. .card-title {
  159. cursor: pointer;
  160. display: block;
  161. }
  162. }
  163. }