alert.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. @include b(alert) {
  5. @include set-component-css-var('alert', $alert);
  6. width: 100%;
  7. padding: getCssVar('alert', 'padding');
  8. margin: 0;
  9. box-sizing: border-box;
  10. border-radius: getCssVar('alert', 'border-radius-base');
  11. position: relative;
  12. background-color: getCssVar('color', 'white');
  13. overflow: hidden;
  14. opacity: 1;
  15. display: flex;
  16. align-items: center;
  17. transition: opacity getCssVar('transition-duration', 'fast');
  18. @include when(light) {
  19. .#{$namespace}-alert__close-btn {
  20. color: getCssVar('text-color', 'placeholder');
  21. }
  22. }
  23. @include when(dark) {
  24. .#{$namespace}-alert__close-btn {
  25. color: getCssVar('color', 'white');
  26. }
  27. .#{$namespace}-alert__description {
  28. color: getCssVar('color', 'white');
  29. }
  30. }
  31. @include when(center) {
  32. justify-content: center;
  33. }
  34. @each $type in (success, info, warning, error) {
  35. @include m($type) {
  36. @include css-var-from-global(
  37. ('alert', 'bg-color'),
  38. ('color', $type, 'light-9')
  39. );
  40. &.is-light {
  41. background-color: getCssVar('alert', 'bg-color');
  42. color: getCssVar('color', $type);
  43. .#{$namespace}-alert__description {
  44. color: getCssVar('color', $type);
  45. }
  46. }
  47. &.is-dark {
  48. background-color: getCssVar('color', $type);
  49. color: getCssVar('color', 'white');
  50. }
  51. }
  52. }
  53. @include e(content) {
  54. display: table-cell;
  55. padding: 0 8px;
  56. }
  57. & .#{$namespace}-alert__icon {
  58. font-size: getCssVar('alert', 'icon-size');
  59. width: getCssVar('alert', 'icon-size');
  60. @include when(big) {
  61. font-size: getCssVar('alert', 'icon-large-size');
  62. width: getCssVar('alert', 'icon-large-size');
  63. }
  64. }
  65. @include e(title) {
  66. font-size: getCssVar('alert', 'title-font-size');
  67. line-height: 18px;
  68. vertical-align: text-top;
  69. @include when(bold) {
  70. font-weight: bold;
  71. }
  72. }
  73. & .#{$namespace}-alert__description {
  74. font-size: getCssVar('alert', 'description-font-size');
  75. margin: 5px 0 0 0;
  76. }
  77. & .#{$namespace}-alert__close-btn {
  78. font-size: getCssVar('alert', 'close-font-size');
  79. opacity: 1;
  80. position: absolute;
  81. top: 12px;
  82. right: 15px;
  83. cursor: pointer;
  84. @include when(customed) {
  85. font-style: normal;
  86. font-size: getCssVar('alert', 'close-customed-font-size');
  87. top: 9px;
  88. }
  89. }
  90. }
  91. .#{$namespace}-alert-fade-enter-from,
  92. .#{$namespace}-alert-fade-leave-active {
  93. opacity: 0;
  94. }