index.less 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @alert-prefix-cls: ~'@{ant-prefix}-alert';
  4. .@{alert-prefix-cls} {
  5. .reset-component();
  6. position: relative;
  7. display: flex;
  8. align-items: center;
  9. padding: @alert-padding-vertical @alert-padding-horizontal;
  10. word-wrap: break-word;
  11. border-radius: @border-radius-base;
  12. &-content {
  13. flex: 1;
  14. min-width: 0;
  15. }
  16. &-icon {
  17. margin-right: @margin-xs;
  18. }
  19. &-description {
  20. display: none;
  21. font-size: @font-size-base;
  22. line-height: @font-size-base + 8px;
  23. }
  24. &-success {
  25. background-color: @alert-success-bg-color;
  26. border: @border-width-base @border-style-base @alert-success-border-color;
  27. .@{alert-prefix-cls}-icon {
  28. color: @alert-success-icon-color;
  29. }
  30. }
  31. &-info {
  32. background-color: @alert-info-bg-color;
  33. border: @border-width-base @border-style-base @alert-info-border-color;
  34. .@{alert-prefix-cls}-icon {
  35. color: @alert-info-icon-color;
  36. }
  37. }
  38. &-warning {
  39. background-color: @alert-warning-bg-color;
  40. border: @border-width-base @border-style-base @alert-warning-border-color;
  41. .@{alert-prefix-cls}-icon {
  42. color: @alert-warning-icon-color;
  43. }
  44. }
  45. &-error {
  46. background-color: @alert-error-bg-color;
  47. border: @border-width-base @border-style-base @alert-error-border-color;
  48. .@{alert-prefix-cls}-icon {
  49. color: @alert-error-icon-color;
  50. }
  51. .@{alert-prefix-cls}-description > pre {
  52. margin: 0;
  53. padding: 0;
  54. }
  55. }
  56. &-action {
  57. margin-left: @margin-xs;
  58. }
  59. &-close-icon {
  60. margin-left: @margin-xs;
  61. padding: 0;
  62. overflow: hidden;
  63. font-size: @font-size-sm;
  64. line-height: @font-size-sm;
  65. background-color: transparent;
  66. border: none;
  67. outline: none;
  68. cursor: pointer;
  69. .@{iconfont-css-prefix}-close {
  70. color: @alert-close-color;
  71. transition: color 0.3s;
  72. &:hover {
  73. color: @alert-close-hover-color;
  74. }
  75. }
  76. }
  77. &-close-text {
  78. color: @alert-close-color;
  79. transition: color 0.3s;
  80. &:hover {
  81. color: @alert-close-hover-color;
  82. }
  83. }
  84. &-with-description {
  85. align-items: flex-start;
  86. padding: @alert-with-description-padding;
  87. }
  88. &-with-description&-no-icon {
  89. padding: @alert-with-description-no-icon-padding-vertical 15px;
  90. }
  91. &-with-description &-icon {
  92. margin-right: @alert-with-description-padding-vertical;
  93. font-size: @alert-with-description-icon-size;
  94. }
  95. &-with-description &-message {
  96. display: block;
  97. margin-bottom: 4px;
  98. color: @alert-message-color;
  99. font-size: @font-size-lg;
  100. }
  101. &-message {
  102. color: @alert-message-color;
  103. }
  104. &-with-description &-description {
  105. display: block;
  106. }
  107. &&-motion-leave {
  108. overflow: hidden;
  109. opacity: 1;
  110. transition: max-height 0.3s @ease-in-out-circ, opacity 0.3s @ease-in-out-circ,
  111. padding-top 0.3s @ease-in-out-circ, padding-bottom 0.3s @ease-in-out-circ,
  112. margin-bottom 0.3s @ease-in-out-circ;
  113. }
  114. &&-motion-leave-active {
  115. max-height: 0;
  116. margin-bottom: 0 !important;
  117. padding-top: 0;
  118. padding-bottom: 0;
  119. opacity: 0;
  120. }
  121. &-banner {
  122. margin-bottom: 0;
  123. border: 0;
  124. border-radius: 0;
  125. }
  126. }
  127. @import './rtl';