toast.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. }
  45. &.#{$module}-success {
  46. .#{$module}-content {
  47. background-color: $color-toast_success_light-bg;
  48. border: $width-toast_light-border solid $color-toast_success_light-border;
  49. }
  50. }
  51. &.#{$module}-info {
  52. .#{$module}-content {
  53. background-color: $color-toast_info_light-bg;
  54. border: $width-toast_light-border solid $color-toast_info_light-border;
  55. }
  56. }
  57. &.#{$module}-error {
  58. .#{$module}-content {
  59. background-color: $color-toast_danger_light-bg;
  60. border: $width-toast_light-border solid $color-toast_danger_light-border;
  61. }
  62. }
  63. }
  64. .#{$icon}-warning {
  65. color: $color-toast_warning-icon;
  66. }
  67. .#{$icon}-success {
  68. color: $color-toast_success-icon;
  69. }
  70. .#{$icon}-info {
  71. color: $color-toast_info-icon;
  72. }
  73. .#{$icon}-error {
  74. color: $color-toast_danger-icon;
  75. }
  76. &-animation-show{
  77. animation: $animation_duration-toast-show #{$module}-keyframe-toast-show $animation_function-toast-show $animation_delay-toast-show ;
  78. }
  79. &-animation-hide{
  80. animation: $animation_duration-toast-hide #{$module}-keyframe-toast-hide $animation_function-toast-hide $animation_delay-toast-hide ;
  81. }
  82. @keyframes #{$module}-keyframe-toast-show{
  83. 0%{
  84. opacity: $animation_opacity-toast-show;
  85. transform: translateY($animation_transform_translateY-toast-show);
  86. }
  87. 100%{
  88. opacity: 1;
  89. }
  90. }
  91. @keyframes #{$module}-keyframe-toast-hide{
  92. 0%{
  93. opacity: 1;
  94. }
  95. 100%{
  96. opacity: $animation_opacity-toast-hide;
  97. transform: translateY($animation_transform_translateY-toast-hide);
  98. }
  99. }
  100. }
  101. @import "./rtl.scss";