ext-component-toastr.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. @import '../../bootstrap-extended/include'; // Bootstrap includes
  2. @import '../../components/include'; // Components includes
  3. // Toast container opacity
  4. #toast-container > div {
  5. opacity: 1;
  6. -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  7. filter: alpha(opacity=100);
  8. max-width: none;
  9. border-radius: $toast-border-radius;
  10. }
  11. // Toast container hover shadow
  12. #toast-container > div,
  13. #toast-container > div:hover {
  14. box-shadow: $toast-box-shadow;
  15. }
  16. #toast-container > .toast {
  17. background-image: none !important;
  18. }
  19. // Toast colors
  20. .toast {
  21. background-color: $white;
  22. color: $body-color !important;
  23. .toast-close-button {
  24. color: $body-color;
  25. font-size: 1.75rem;
  26. font-weight: $font-weight-normal;
  27. top: 0;
  28. right: 0;
  29. text-shadow: none;
  30. &:focus {
  31. outline: none;
  32. }
  33. }
  34. .toast-title {
  35. font-size: $font-size-base;
  36. font-weight: $font-weight-bolder;
  37. line-height: 1.75;
  38. }
  39. .toast-progress {
  40. opacity: 1;
  41. }
  42. &:before {
  43. content: '';
  44. height: 24px;
  45. width: 24px;
  46. border-radius: 50%;
  47. color: $white;
  48. position: absolute;
  49. left: 1.25rem;
  50. background-size: $font-size-base;
  51. background-repeat: no-repeat;
  52. background-position: center;
  53. }
  54. }
  55. // we are using only few colors in toast so not adding in palette.scss
  56. // plugin class name 'error' is also differ then ours so not useful to add in palette
  57. .toast-success {
  58. .toast-title {
  59. color: $success;
  60. }
  61. .toast-progress {
  62. background-color: $success;
  63. }
  64. &:before {
  65. background-color: $success;
  66. background-image: url(str-replace(str-replace($check, 'currentColor', $white), '#', '%23'));
  67. }
  68. }
  69. .toast-error {
  70. .toast-title {
  71. color: $danger;
  72. }
  73. .toast-progress {
  74. background-color: $danger;
  75. }
  76. &:before {
  77. background-color: $danger;
  78. background-image: url(str-replace(str-replace($remove, 'currentColor', $white), '#', '%23'));
  79. }
  80. }
  81. .toast-info {
  82. .toast-title {
  83. color: $info;
  84. }
  85. .toast-progress {
  86. background-color: $info;
  87. }
  88. &:before {
  89. background-color: $info;
  90. background-image: url(str-replace(str-replace($infoIcon, 'currentColor', $white), '#', '%23'));
  91. }
  92. }
  93. .toast-warning {
  94. .toast-title {
  95. color: $warning;
  96. }
  97. .toast-progress {
  98. background-color: $warning;
  99. }
  100. &:before {
  101. background-color: $warning;
  102. background-image: url(str-replace(str-replace($warningIcon, 'currentColor', $white), '#', '%23'));
  103. }
  104. }
  105. // position alignments
  106. .toast-top-left {
  107. top: 1.3rem;
  108. left: $content-padding;
  109. }
  110. .toast-top-right {
  111. top: 1.3rem;
  112. right: $content-padding;
  113. }
  114. .toast-top-center,
  115. .toast-top-full-width {
  116. top: 1.3rem;
  117. }
  118. .toast-bottom-left {
  119. bottom: 1.3rem;
  120. left: $content-padding;
  121. }
  122. .toast-bottom-right {
  123. bottom: 1.3rem;
  124. right: $content-padding;
  125. }
  126. .toast-bottom-center,
  127. .toast-bottom-full-width {
  128. bottom: 1.3rem;
  129. }
  130. // Media query
  131. @media (max-width: 480px) and (min-width: 241px) {
  132. #toast-container > .toast {
  133. &:after {
  134. top: 0.95rem;
  135. }
  136. .toast-close-button {
  137. top: 0;
  138. right: -1px;
  139. }
  140. }
  141. #toast-container:not(.toast-top-full-width):not(.toast-bottom-full-width) > div {
  142. width: 20rem;
  143. }
  144. .toast-top-left {
  145. left: 0;
  146. }
  147. #toast-container {
  148. &.toast-top-center,
  149. &.toast-bottom-center {
  150. right: 1rem;
  151. > div {
  152. width: 20rem !important;
  153. }
  154. }
  155. }
  156. .toast-top-full-width,
  157. .toast-bottom-full-width {
  158. right: 0;
  159. left: 0;
  160. width: 93%;
  161. > div {
  162. width: 100%;
  163. }
  164. }
  165. .toast-bottom-left {
  166. left: 0.25rem;
  167. bottom: 0.75rem;
  168. }
  169. .toast-bottom-right {
  170. right: 2.25rem;
  171. bottom: 0.75rem;
  172. }
  173. .toast-bottom-center,
  174. .toast-bottom-full-width {
  175. bottom: 0.75rem;
  176. }
  177. [data-textdirection='rtl'] {
  178. #toast-container > div {
  179. padding-right: 8px;
  180. }
  181. }
  182. }
  183. // Toastr Dark Layout
  184. .dark-layout {
  185. #toast-container > div,
  186. #toast-container > div:hover {
  187. box-shadow: $theme-dark-box-shadow;
  188. }
  189. #toast-container {
  190. .toast {
  191. background-color: $theme-dark-card-bg;
  192. color: $theme-dark-body-color !important;
  193. .toast-close-button {
  194. color: $theme-dark-body-color;
  195. }
  196. }
  197. }
  198. }
  199. [data-textdirection='rtl'] {
  200. .toast .toast-close-button {
  201. @include media-breakpoint-down(xs) {
  202. top: 0.55rem !important;
  203. right: 0.5rem !important;
  204. }
  205. }
  206. .toast-top-left {
  207. left: 1rem;
  208. right: auto;
  209. }
  210. .toast-top-right {
  211. right: 3rem;
  212. left: auto;
  213. }
  214. .toast-bottom-left {
  215. left: 1em;
  216. right: auto;
  217. }
  218. .toast-bottom-right {
  219. right: 3rem;
  220. left: auto;
  221. }
  222. .toast-top-full-width,
  223. .toast-bottom-full-width {
  224. &#toast-container > div {
  225. left: 0;
  226. right: 0;
  227. }
  228. }
  229. }