index.less 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. @import '../style/var';
  2. @import '../style/mixins/ellipsis';
  3. .van-card {
  4. position: relative;
  5. color: @card-text-color;
  6. padding: @card-padding;
  7. font-size: @card-font-size;
  8. box-sizing: border-box;
  9. background-color: @card-background-color;
  10. &:not(:first-child) {
  11. margin-top: 10px;
  12. }
  13. &__header {
  14. display: flex;
  15. }
  16. &__thumb {
  17. display: flex;
  18. position: relative;
  19. width: @card-thumb-size;
  20. height: @card-thumb-size;
  21. margin-right: 10px;
  22. flex: none;
  23. align-items: center;
  24. justify-content: center;
  25. img {
  26. border: none;
  27. max-width: 100%;
  28. max-height: 100%;
  29. }
  30. }
  31. &__content {
  32. position: relative;
  33. display: flex;
  34. flex: 1;
  35. height: @card-thumb-size;
  36. flex-direction: column;
  37. min-width: 0; /* hack for flex box ellipsis */
  38. &--centered {
  39. justify-content: center;
  40. }
  41. }
  42. &__title,
  43. &__desc {
  44. word-break: break-all;
  45. }
  46. &__title {
  47. line-height: @card-title-line-height;
  48. max-height: 32px;
  49. font-weight: 500;
  50. .multi-ellipsis(2);
  51. }
  52. &__desc {
  53. color: @card-desc-color;
  54. max-height: @card-desc-line-height;
  55. line-height: @card-desc-line-height;
  56. }
  57. &__bottom {
  58. line-height: 20px;
  59. }
  60. &__price {
  61. display: inline-block;
  62. color: @card-price-color;
  63. font-weight: 500;
  64. }
  65. &__origin-price {
  66. display: inline-block;
  67. margin-left: 5px;
  68. color: @card-origin-price-color;
  69. font-size: @card-origin-price-font-size;
  70. text-decoration: line-through;
  71. }
  72. &__num {
  73. float: right;
  74. }
  75. &__tag {
  76. position: absolute;
  77. top: 2px;
  78. left: 0;
  79. }
  80. &__footer {
  81. text-align: right;
  82. flex: none;
  83. .van-button {
  84. margin-left: 5px;
  85. }
  86. }
  87. }