card.md.scss 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. @import "../../themes/ionic.globals.md";
  2. // Material Design Card
  3. // --------------------------------------------------
  4. /// @prop - Margin top of the card
  5. $card-md-margin-top: 10px !default;
  6. // deprecated
  7. $card-md-margin-right: 10px !default;
  8. /// @prop - Margin end of the card
  9. $card-md-margin-end: $card-md-margin-right !default;
  10. /// @prop - Margin bottom of the card
  11. $card-md-margin-bottom: 10px !default;
  12. // deprecated
  13. $card-md-margin-left: 10px !default;
  14. /// @prop - Margin start of the card
  15. $card-md-margin-start: $card-md-margin-left !default;
  16. /// @prop - Padding top of the card
  17. $card-md-padding-top: 13px !default;
  18. // deprecated
  19. $card-md-padding-right: 16px !default;
  20. /// @prop - Padding right of the card
  21. $card-md-padding-end: $card-md-padding-right !default;
  22. /// @prop - Padding bottom of the card
  23. $card-md-padding-bottom: 13px !default;
  24. // deprecated
  25. $card-md-padding-left: 16px !default;
  26. /// @prop - Padding start of the card
  27. $card-md-padding-start: $card-md-padding-left !default;
  28. /// @prop - Padding top of the media on the card
  29. $card-md-padding-media-top: 10px !default;
  30. /// @prop - Padding bottom of the media on the card
  31. $card-md-padding-media-bottom: 10px !default;
  32. /// @prop - Size of the card avatar
  33. $card-md-avatar-size: 4rem !default;
  34. /// @prop - Size of the card thumbnail
  35. $card-md-thumbnail-size: 8rem !default;
  36. /// @prop - Background color of the card
  37. $card-md-background-color: $list-md-background-color !default;
  38. /// @prop - Box shadow of the card
  39. $card-md-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
  40. /// @prop - Border radius of the card
  41. $card-md-border-radius: 2px !default;
  42. /// @prop - Font size of the card
  43. $card-md-font-size: 1.4rem !default;
  44. /// @prop - Line height of the card
  45. $card-md-line-height: 1.5 !default;
  46. /// @prop - Color of the card text
  47. $card-md-text-color: #222 !default;
  48. /// @prop - Font size of the card title
  49. $card-md-title-font-size: 2.4rem !default;
  50. // deprecated
  51. $card-md-title-padding: null !default;
  52. /// @prop - Padding top of the card title
  53. $card-md-title-padding-top: 8px !default;
  54. /// @prop - Padding end of the card title
  55. $card-md-title-padding-end: 0 !default;
  56. /// @prop - Padding bottom of the card title
  57. $card-md-title-padding-bottom: 8px !default;
  58. /// @prop - Padding start of the card title
  59. $card-md-title-padding-start: 0 !default;
  60. // deprecated
  61. $card-md-title-margin: null !default;
  62. /// @prop - Margin top of the card title
  63. $card-md-title-margin-top: 2px !default;
  64. /// @prop - Margin end of the card title
  65. $card-md-title-margin-end: 0 !default;
  66. /// @prop - Margin bottom of the card title
  67. $card-md-title-margin-bottom: 2px !default;
  68. /// @prop - Margin start of the card title
  69. $card-md-title-margin-start: $card-md-title-margin-end !default;
  70. /// @prop - Color of the card title
  71. $card-md-title-text-color: #222 !default;
  72. /// @prop - Font size of the card header
  73. $card-md-header-font-size: 1.6rem !default;
  74. // deprecated
  75. $card-md-header-padding: null !default;
  76. /// @prop - Padding top of the card header
  77. $card-md-header-padding-top: 16px !default;
  78. /// @prop - Padding end of the card header
  79. $card-md-header-padding-end: $card-md-header-padding-top !default;
  80. /// @prop - Padding bottom of the card header
  81. $card-md-header-padding-bottom: $card-md-header-padding-top !default;
  82. /// @prop - Padding start of the card header
  83. $card-md-header-padding-start: $card-md-header-padding-end !default;
  84. /// @prop - Color of the card header
  85. $card-md-header-color: #222 !default;
  86. .card-md {
  87. @include margin($card-md-margin-top, $card-md-margin-end, $card-md-margin-bottom, $card-md-margin-start);
  88. @include border-radius($card-md-border-radius);
  89. width: calc(100% - #{($card-md-margin-end + $card-md-margin-start)});
  90. font-size: $card-md-font-size;
  91. background: $card-md-background-color;
  92. box-shadow: $card-md-box-shadow;
  93. }
  94. .card-md ion-list {
  95. @include margin(null, null, 0, null);
  96. }
  97. .card-md > .item:last-child,
  98. .card-md > .item:last-child .item-inner,
  99. .card-md > .item-wrapper:last-child .item {
  100. border-bottom: 0;
  101. }
  102. .card-md .item-md.item-block .item-inner {
  103. border: 0;
  104. }
  105. .card-content-md {
  106. @include padding($card-md-padding-top, $card-md-padding-end, $card-md-padding-bottom, $card-md-padding-start);
  107. font-size: $card-md-font-size;
  108. line-height: $card-md-line-height;
  109. }
  110. .card-header-md {
  111. font-size: $card-md-header-font-size;
  112. color: $card-md-header-color;
  113. @include deprecated-variable(padding, $card-md-header-padding) {
  114. @include padding($card-md-header-padding-top, $card-md-header-padding-end, $card-md-header-padding-bottom, $card-md-header-padding-start);
  115. }
  116. }
  117. .card-header-md + .card-content-md,
  118. .card-md .item + .card-content-md {
  119. @include padding(0, null, null, null);
  120. }
  121. .card .note-md {
  122. font-size: 1.3rem;
  123. }
  124. .card-title-md {
  125. display: block;
  126. font-size: $card-md-title-font-size;
  127. line-height: 1.2;
  128. color: $card-md-title-text-color;
  129. @include deprecated-variable(margin, $card-md-title-margin) {
  130. @include margin($card-md-title-margin-top, $card-md-title-margin-end, $card-md-title-margin-bottom, $card-md-title-margin-start);
  131. }
  132. @include deprecated-variable(padding, $card-md-title-padding) {
  133. @include padding($card-md-title-padding-top, $card-md-title-padding-end, $card-md-title-padding-bottom, $card-md-title-padding-start);
  134. }
  135. }
  136. .card-md h1 {
  137. @include margin(0, 0, 2px);
  138. font-size: 2.4rem;
  139. font-weight: normal;
  140. color: $card-md-text-color;
  141. }
  142. .card-md h2 {
  143. @include margin(2px, 0);
  144. font-size: 1.6rem;
  145. font-weight: normal;
  146. color: $card-md-text-color;
  147. }
  148. .card-md h3,
  149. .card-md h4,
  150. .card-md h5,
  151. .card-md h6 {
  152. @include margin(2px, 0);
  153. font-size: 1.4rem;
  154. font-weight: normal;
  155. color: $card-md-text-color;
  156. }
  157. .card-md p {
  158. @include margin(0, 0, 2px);
  159. font-size: 1.4rem;
  160. font-weight: normal;
  161. line-height: 1.5;
  162. color: $card-md-text-color;
  163. }
  164. .card-md + ion-card {
  165. @include margin(0, null, null, null);
  166. }
  167. // Generate Material Design Card Colors
  168. // --------------------------------------------------
  169. @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
  170. .card-md .text-md-#{$color-name} {
  171. color: $color-base;
  172. }
  173. .card-md-#{$color-name} {
  174. color: $color-contrast;
  175. background-color: $color-base;
  176. .card-header-md,
  177. .card-title-md,
  178. .card-content-md,
  179. h1,
  180. h2,
  181. h3,
  182. h4,
  183. h5,
  184. h6,
  185. p {
  186. color: $color-contrast;
  187. }
  188. @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
  189. .text-md-#{$color-name},
  190. .card-header-md-#{$color-name},
  191. .card-title-md-#{$color-name},
  192. .card-content-md-#{$color-name} {
  193. color: $color-base;
  194. }
  195. }
  196. }
  197. .card-header-md-#{$color-name},
  198. .card-title-md-#{$color-name},
  199. .card-content-md-#{$color-name} {
  200. color: $color-base;
  201. }
  202. }