4226c042d988cf35e678a4a798d17c48f0782d5dee6f30b3230a9af12d38d0b991748b89491923a2c66c2d48eb9b204788232cbb655306053a4cd01291ac57 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @mixin genTheme($backgroundColorWeight, $borderColorWeight, $fontColorWeight, $hoverColorWeight) {
  4. background-color: mix($--tag-primary-color, $--color-white, $backgroundColorWeight);
  5. border-color: mix($--tag-primary-color, $--color-white, $borderColorWeight);
  6. color: mix($--tag-primary-color, $--color-white, $fontColorWeight);
  7. @include when(hit) {
  8. border-color: $--tag-primary-color;
  9. }
  10. .el-tag__close {
  11. color: mix($--tag-primary-color, $--color-white, $fontColorWeight);
  12. &:hover {
  13. color: $--color-white;
  14. background-color: mix($--tag-primary-color, $--color-white, $hoverColorWeight);
  15. }
  16. }
  17. &.el-tag--info {
  18. background-color: mix($--tag-info-color, $--color-white, $backgroundColorWeight);
  19. border-color: mix($--tag-info-color, $--color-white, $borderColorWeight);
  20. color: mix($--tag-info-color, $--color-white, $fontColorWeight);
  21. @include when(hit) {
  22. border-color: $--tag-info-color;
  23. }
  24. .el-tag__close {
  25. color: mix($--tag-info-color, $--color-white, $fontColorWeight);
  26. &:hover {
  27. color: $--color-white;
  28. background-color: mix($--tag-info-color, $--color-white, $hoverColorWeight);
  29. }
  30. }
  31. }
  32. &.el-tag--success {
  33. background-color: mix($--tag-success-color, $--color-white, $backgroundColorWeight);
  34. border-color: mix($--tag-success-color, $--color-white, $borderColorWeight);
  35. color: mix($--tag-success-color, $--color-white, $fontColorWeight);
  36. @include when(hit) {
  37. border-color: $--tag-success-color;
  38. }
  39. .el-tag__close {
  40. color: mix($--tag-success-color, $--color-white, $fontColorWeight);
  41. &:hover {
  42. color: $--color-white;
  43. background-color: mix($--tag-success-color, $--color-white, $hoverColorWeight);
  44. }
  45. }
  46. }
  47. &.el-tag--warning {
  48. background-color: mix($--tag-warning-color, $--color-white, $backgroundColorWeight);
  49. border-color: mix($--tag-warning-color, $--color-white, $borderColorWeight);
  50. color: mix($--tag-warning-color, $--color-white, $fontColorWeight);
  51. @include when(hit) {
  52. border-color: $--tag-warning-color;
  53. }
  54. .el-tag__close {
  55. color: mix($--tag-warning-color, $--color-white, $fontColorWeight);
  56. &:hover {
  57. color: $--color-white;
  58. background-color: mix($--tag-warning-color, $--color-white, $hoverColorWeight);
  59. }
  60. }
  61. }
  62. &.el-tag--danger {
  63. background-color: mix($--tag-danger-color, $--color-white, $backgroundColorWeight);
  64. border-color: mix($--tag-danger-color, $--color-white, $borderColorWeight);
  65. color: mix($--tag-danger-color, $--color-white, $fontColorWeight);
  66. @include when(hit) {
  67. border-color: $--tag-danger-color;
  68. }
  69. .el-tag__close {
  70. color: mix($--tag-danger-color, $--color-white, $fontColorWeight);
  71. &:hover {
  72. color: $--color-white;
  73. background-color: mix($--tag-danger-color, $--color-white, $hoverColorWeight);
  74. }
  75. }
  76. }
  77. }
  78. @include b(tag) {
  79. @include genTheme(10%, 20%, 100%, 100%);
  80. display: inline-block;
  81. height: 32px;
  82. padding: $--tag-padding;
  83. line-height: 30px;
  84. font-size: $--tag-font-size;
  85. color: $--tag-primary-color;
  86. border-width: 1px;
  87. border-style: solid;
  88. border-radius: $--tag-border-radius;
  89. box-sizing: border-box;
  90. white-space: nowrap;
  91. .el-icon-close {
  92. border-radius: 50%;
  93. text-align: center;
  94. position: relative;
  95. cursor: pointer;
  96. font-size: 12px;
  97. height: 16px;
  98. width: 16px;
  99. line-height: 16px;
  100. vertical-align: middle;
  101. top: -1px;
  102. right: -5px;
  103. &::before {
  104. display: block;
  105. }
  106. }
  107. @include m(dark) {
  108. @include genTheme(100%, 100%, 0, 80%);
  109. }
  110. @include m(plain) {
  111. @include genTheme(0, 40%, 100%, 100%);
  112. }
  113. @include m(medium) {
  114. height: 28px;
  115. line-height: 26px;
  116. .el-icon-close {
  117. transform: scale(.8);
  118. }
  119. }
  120. @include m(small) {
  121. height: 24px;
  122. padding: 0 8px;
  123. line-height: 22px;
  124. .el-icon-close {
  125. transform: scale(.8);
  126. }
  127. }
  128. @include m(mini) {
  129. height: 20px;
  130. padding: 0 5px;
  131. line-height: 19px;
  132. .el-icon-close {
  133. margin-left: -3px;
  134. transform: scale(.7);
  135. }
  136. }
  137. }