card.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @import "./variables.scss";
  2. $module: #{$prefix}-card;
  3. .#{$module} {
  4. box-sizing: border-box;
  5. margin: 0;
  6. padding: 0;
  7. border-radius: $radius-card;
  8. overflow: hidden;
  9. background-color: $color-card-bg-default;
  10. font-size: $font-card_default-fontSize;
  11. font-style: normal;
  12. font-weight: $font-card_default-fontWeight;
  13. line-height: $font-card_default-lineHeight;
  14. letter-spacing: 0em;
  15. &-shadows {
  16. cursor: pointer;
  17. transition: box-shadow $motion-card-transition_duration;
  18. &-hover {
  19. &:hover {
  20. box-shadow: $shadow-card;
  21. z-index: $z-card_hover; // 避免网格型卡片组shadow覆盖
  22. }
  23. }
  24. &-always {
  25. box-shadow: $shadow-card;
  26. }
  27. }
  28. &-bordered {
  29. border: $width-card-border solid $color-card-border;
  30. }
  31. &-header {
  32. padding: $spacing-card-padding;
  33. &-bordered {
  34. border-bottom: $width-card-border solid $color-card-border;
  35. }
  36. &-wrapper {
  37. display: flex;
  38. align-items: flex-start;
  39. flex-direction: row-reverse;
  40. justify-content: space-between;
  41. &-spacing {
  42. margin-right: $spacing-card-margin;
  43. }
  44. &-title {
  45. width: 100%;
  46. overflow: hidden;
  47. }
  48. &-extra {
  49. flex-shrink: 0;
  50. font-size: $font-card_extra-fontSize;
  51. font-style: normal;
  52. font-weight: $font-card_extra-fontWeight;
  53. letter-spacing: 0em;
  54. color: $color-card_extra-text;
  55. }
  56. }
  57. }
  58. &-cover {
  59. > * {
  60. display: block;
  61. width: 100%;
  62. }
  63. }
  64. &-body {
  65. padding: $spacing-card-padding;
  66. font-size: $font-card_default-fontSize;
  67. font-style: normal;
  68. font-weight: $font-card_default-fontWeight;
  69. line-height: $font-card_default-lineHeight;
  70. letter-spacing: 0em;
  71. color: $color-card_body-text;
  72. &-actions {
  73. margin-top: $spacing-card-margin;
  74. padding-top: $spacing-card-padding;
  75. border-top: $width-card-border solid $color-card-border;
  76. }
  77. }
  78. &-footer {
  79. padding: $spacing-card-padding;
  80. &-bordered {
  81. border-top: $width-card-border solid $color-card-border;
  82. }
  83. }
  84. &-meta {
  85. display: flex;
  86. align-items: center;
  87. justify-content: flex-start;
  88. &-avatar {
  89. margin-right: $spacing-card_avatar-marginRight;
  90. }
  91. &-wrapper {
  92. &-title {
  93. font-size: $font-card_title-fontSize;
  94. font-style: normal;
  95. font-weight: $font-card_title-fontWeight;
  96. line-height: $font-card_title-lineHeight;
  97. letter-spacing: 0em;
  98. color: $color-card_title-text;
  99. }
  100. &-description {
  101. font-size: $font-card_default-fontSize;
  102. font-style: normal;
  103. font-weight: $font-card_default-fontWeight;
  104. line-height: $font-card_default-lineHeight;
  105. letter-spacing: 0em;
  106. color: $color-card_description-text;
  107. }
  108. }
  109. }
  110. }
  111. .#{$module}-group {
  112. &-grid {
  113. & .#{$module} {
  114. border-radius: 0;
  115. }
  116. & .#{$prefix}-card {
  117. margin-left: $spacing-cardGroup_card-margin;
  118. margin-top: $spacing-cardGroup_card-margin;
  119. }
  120. }
  121. }
  122. @import "./rtl.scss";