toast.scss 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @import "./animation.scss";
  2. @import "./variables.scss";
  3. $module: #{$prefix}-toast;
  4. $icon: #{$prefix}-toast-icon;
  5. .#{$module} {
  6. pointer-events: none;
  7. &-wrapper {
  8. pointer-events: none;
  9. position: fixed;
  10. top: $spacing-toast_wrapper-top;
  11. width: $width-toast_wrapper;
  12. text-align: center;
  13. z-index: $z-toast;
  14. }
  15. &-content {
  16. pointer-events: all;
  17. @include shadow-elevated;
  18. @include font-size-regular;
  19. background-color: $color-toast-bg-default;
  20. border-radius: $radius-toast_content;
  21. padding: $spacing-toast_content-paddingY $spacing-toast_content-paddingX;
  22. display: inline-flex;
  23. align-items: flex-start;
  24. justify-content: center;
  25. margin: $spacing-toast_content-margin;
  26. font-weight: $font-toast_content-fontWeight;
  27. color: $color-toast-text-default;
  28. .#{$module}-close-button {
  29. margin-top: $spacing-toast_content_close_btn-marginTop;
  30. height: $width-icon-large;
  31. }
  32. .#{$module}-content-text {
  33. margin-left: $spacing-toast_content_text-marginLeft;
  34. margin-right: $spacing-toast_content_text-marginRight;
  35. text-align: left;
  36. }
  37. }
  38. &-light {
  39. &.#{$module}-warning {
  40. .#{$module}-content {
  41. background-color: $color-toast_warning_light-bg;
  42. border: $width-toast_light-border solid $color-toast_warning_light-border;
  43. }
  44. .#{$icon}-warning {
  45. color: $color-toast_warning_light-icon;
  46. }
  47. }
  48. &.#{$module}-success {
  49. .#{$module}-content {
  50. background-color: $color-toast_success_light-bg;
  51. border: $width-toast_light-border solid $color-toast_success_light-border;
  52. }
  53. .#{$icon}-success {
  54. color: $color-toast_success_light-icon;
  55. }
  56. }
  57. &.#{$module}-info {
  58. .#{$module}-content {
  59. background-color: $color-toast_info_light-bg;
  60. border: $width-toast_light-border solid $color-toast_info_light-border;
  61. }
  62. .#{$icon}-info {
  63. color: $color-toast_info_light-icon;
  64. }
  65. }
  66. &.#{$module}-error {
  67. .#{$module}-content {
  68. background-color: $color-toast_danger_light-bg;
  69. border: $width-toast_light-border solid $color-toast_danger_light-border;
  70. }
  71. .#{$icon}-error {
  72. color: $color-toast_danger_light-icon;
  73. }
  74. }
  75. }
  76. .#{$icon}-warning {
  77. color: $color-toast_warning-icon;
  78. }
  79. .#{$icon}-success {
  80. color: $color-toast_success-icon;
  81. }
  82. .#{$icon}-info {
  83. color: $color-toast_info-icon;
  84. }
  85. .#{$icon}-error {
  86. color: $color-toast_danger-icon;
  87. }
  88. &-animation-show{
  89. animation: $animation_duration-toast-show #{$module}-keyframe-toast-show $animation_function-toast-show $animation_delay-toast-show ;
  90. animation-fill-mode: forwards;
  91. }
  92. &-animation-hide{
  93. animation: $animation_duration-toast-hide #{$module}-keyframe-toast-hide $animation_function-toast-hide $animation_delay-toast-hide ;
  94. animation-fill-mode: forwards;
  95. }
  96. @keyframes #{$module}-keyframe-toast-show{
  97. 0%{
  98. opacity: $animation_opacity-toast-show;
  99. transform: translateY($animation_transform_translateY-toast-show);
  100. }
  101. 100%{
  102. opacity: 1;
  103. }
  104. }
  105. @keyframes #{$module}-keyframe-toast-hide{
  106. 0%{
  107. opacity: 1;
  108. }
  109. 100%{
  110. opacity: $animation_opacity-toast-hide;
  111. transform: translateY($animation_transform_translateY-toast-hide);
  112. }
  113. }
  114. }
  115. @import "./rtl.scss";