index.less 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @import '../style/var';
  2. .van-uploader {
  3. position: relative;
  4. display: inline-block;
  5. &__wrapper {
  6. display: flex;
  7. flex-wrap: wrap;
  8. &--disabled {
  9. opacity: @uploader-disabled-opacity;
  10. }
  11. }
  12. &__input {
  13. position: absolute;
  14. top: 0;
  15. left: 0;
  16. width: 100%;
  17. height: 100%;
  18. overflow: hidden; // to clip file-upload-button
  19. cursor: pointer;
  20. opacity: 0;
  21. &-wrapper {
  22. position: relative;
  23. }
  24. &:disabled {
  25. cursor: not-allowed;
  26. }
  27. }
  28. &__upload {
  29. position: relative;
  30. display: flex;
  31. flex-direction: column;
  32. align-items: center;
  33. justify-content: center;
  34. box-sizing: border-box;
  35. width: @uploader-size;
  36. height: @uploader-size;
  37. margin: 0 @padding-xs @padding-xs 0;
  38. background-color: @uploader-upload-background-color;
  39. &:active {
  40. background-color: @uploader-upload-active-color;
  41. }
  42. &--readonly:active {
  43. background-color: @uploader-upload-background-color;
  44. }
  45. &-icon {
  46. color: @uploader-icon-color;
  47. font-size: @uploader-icon-size;
  48. }
  49. &-text {
  50. margin-top: @padding-xs;
  51. color: @uploader-text-color;
  52. font-size: @uploader-text-font-size;
  53. }
  54. }
  55. &__preview {
  56. position: relative;
  57. margin: 0 @padding-xs @padding-xs 0;
  58. cursor: pointer;
  59. &-image {
  60. display: block;
  61. width: @uploader-size;
  62. height: @uploader-size;
  63. overflow: hidden;
  64. }
  65. &-delete {
  66. position: absolute;
  67. top: 0;
  68. right: 0;
  69. width: @uploader-delete-icon-size;
  70. height: @uploader-delete-icon-size;
  71. background-color: @uploader-delete-background-color;
  72. border-radius: 0 0 0 12px;
  73. &-icon {
  74. position: absolute;
  75. top: -2px;
  76. right: -2px;
  77. color: #fff;
  78. color: @uploader-delete-color;
  79. font-size: 16px;
  80. transform: scale(0.5);
  81. }
  82. }
  83. &-cover {
  84. position: absolute;
  85. top: 0;
  86. right: 0;
  87. bottom: 0;
  88. left: 0;
  89. }
  90. }
  91. &__mask {
  92. position: absolute;
  93. top: 0;
  94. right: 0;
  95. bottom: 0;
  96. left: 0;
  97. display: flex;
  98. flex-direction: column;
  99. align-items: center;
  100. justify-content: center;
  101. color: @white;
  102. background-color: @uploader-mask-background-color;
  103. &-icon {
  104. font-size: @uploader-mask-icon-size;
  105. }
  106. &-message {
  107. margin-top: 6px;
  108. padding: 0 @padding-base;
  109. font-size: @uploader-mask-message-font-size;
  110. line-height: @uploader-mask-message-line-height;
  111. }
  112. }
  113. &__loading {
  114. width: @uploader-loading-icon-size;
  115. height: @uploader-loading-icon-size;
  116. color: @uploader-loading-icon-color;
  117. }
  118. &__file {
  119. display: flex;
  120. flex-direction: column;
  121. align-items: center;
  122. justify-content: center;
  123. width: @uploader-size;
  124. height: @uploader-size;
  125. background-color: @uploader-file-background-color;
  126. &-icon {
  127. color: @uploader-file-icon-color;
  128. font-size: @uploader-file-icon-size;
  129. }
  130. &-name {
  131. box-sizing: border-box;
  132. width: 100%;
  133. margin-top: @uploader-file-name-margin-top;
  134. padding: @uploader-file-name-padding;
  135. color: @uploader-file-name-text-color;
  136. font-size: @uploader-file-name-font-size;
  137. text-align: center;
  138. }
  139. }
  140. }