toastr.less 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. // Mix-ins
  2. .borderRadius(@radius) {
  3. -moz-border-radius: @radius;
  4. -webkit-border-radius: @radius;
  5. border-radius: @radius;
  6. }
  7. .boxShadow(@boxShadow) {
  8. -moz-box-shadow: @boxShadow;
  9. -webkit-box-shadow: @boxShadow;
  10. box-shadow: @boxShadow;
  11. }
  12. .opacity(@opacity) {
  13. @opacityPercent: (@opacity * 100);
  14. opacity: @opacity;
  15. -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{opacityPercent})";
  16. filter: ~"alpha(opacity=@{opacityPercent})";
  17. }
  18. .wordWrap(@wordWrap: break-word) {
  19. -ms-word-wrap: @wordWrap;
  20. word-wrap: @wordWrap;
  21. }
  22. // Variables
  23. @black: #000000;
  24. @grey: #999999;
  25. @light-grey: #CCCCCC;
  26. @white: #FFFFFF;
  27. @near-black: #030303;
  28. @green: #51A351;
  29. @red: #BD362F;
  30. @blue: #2F96B4;
  31. @orange: #F89406;
  32. @default-container-opacity: .8;
  33. // Styles
  34. .toast-title {
  35. font-weight: bold;
  36. }
  37. .toast-message {
  38. .wordWrap();
  39. a,
  40. label {
  41. color: @white;
  42. }
  43. a:hover {
  44. color: @light-grey;
  45. text-decoration: none;
  46. }
  47. }
  48. .toast-close-button {
  49. position: relative;
  50. right: -0.3em;
  51. top: -0.3em;
  52. float: right;
  53. font-size: 20px;
  54. font-weight: bold;
  55. color: @white;
  56. -webkit-text-shadow: 0 1px 0 rgba(255,255,255,1);
  57. text-shadow: 0 1px 0 rgba(255,255,255,1);
  58. .opacity(0.8);
  59. line-height: 1;
  60. &:hover,
  61. &:focus {
  62. color: @black;
  63. text-decoration: none;
  64. cursor: pointer;
  65. .opacity(0.4);
  66. }
  67. }
  68. .rtl .toast-close-button {
  69. left: -0.3em;
  70. float: left;
  71. right: 0.3em;
  72. }
  73. /*Additional properties for button version
  74. iOS requires the button element instead of an anchor tag.
  75. If you want the anchor version, it requires `href="#"`.*/
  76. button.toast-close-button {
  77. padding: 0;
  78. cursor: pointer;
  79. background: transparent;
  80. border: 0;
  81. -webkit-appearance: none;
  82. }
  83. //#endregion
  84. .toast-top-center {
  85. top: 0;
  86. right: 0;
  87. width: 100%;
  88. }
  89. .toast-bottom-center {
  90. bottom: 0;
  91. right: 0;
  92. width: 100%;
  93. }
  94. .toast-top-full-width {
  95. top: 0;
  96. right: 0;
  97. width: 100%;
  98. }
  99. .toast-bottom-full-width {
  100. bottom: 0;
  101. right: 0;
  102. width: 100%;
  103. }
  104. .toast-top-left {
  105. top: 12px;
  106. left: 12px;
  107. }
  108. .toast-top-right {
  109. top: 12px;
  110. right: 12px;
  111. }
  112. .toast-bottom-right {
  113. right: 12px;
  114. bottom: 12px;
  115. }
  116. .toast-bottom-left {
  117. bottom: 12px;
  118. left: 12px;
  119. }
  120. #toast-container {
  121. position: fixed;
  122. z-index: 999999;
  123. // The container should not be clickable.
  124. pointer-events: none;
  125. * {
  126. -moz-box-sizing: border-box;
  127. -webkit-box-sizing: border-box;
  128. box-sizing: border-box;
  129. }
  130. > div {
  131. position: relative;
  132. // The toast itself should be clickable.
  133. pointer-events: auto;
  134. overflow: hidden;
  135. margin: 0 0 6px;
  136. padding: 15px 15px 15px 50px;
  137. width: 300px;
  138. .borderRadius(3px 3px 3px 3px);
  139. background-position: 15px center;
  140. background-repeat: no-repeat;
  141. .boxShadow(0 0 12px @grey);
  142. color: @white;
  143. .opacity(@default-container-opacity);
  144. }
  145. > div.rtl {
  146. direction: rtl;
  147. padding: 15px 50px 15px 15px;
  148. background-position: right 15px center;
  149. }
  150. > div:hover {
  151. .boxShadow(0 0 12px @black);
  152. .opacity(1);
  153. cursor: pointer;
  154. }
  155. > .toast-info {
  156. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important;
  157. }
  158. > .toast-error {
  159. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important;
  160. }
  161. > .toast-success {
  162. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important;
  163. }
  164. > .toast-warning {
  165. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important;
  166. }
  167. /*overrides*/
  168. &.toast-top-center > div,
  169. &.toast-bottom-center > div {
  170. width: 300px;
  171. margin-left: auto;
  172. margin-right: auto;
  173. }
  174. &.toast-top-full-width > div,
  175. &.toast-bottom-full-width > div {
  176. width: 96%;
  177. margin-left: auto;
  178. margin-right: auto;
  179. }
  180. }
  181. .toast {
  182. background-color: @near-black;
  183. }
  184. .toast-success {
  185. background-color: @green;
  186. }
  187. .toast-error {
  188. background-color: @red;
  189. }
  190. .toast-info {
  191. background-color: @blue;
  192. }
  193. .toast-warning {
  194. background-color: @orange;
  195. }
  196. .toast-progress {
  197. position: absolute;
  198. left: 0;
  199. bottom: 0;
  200. height: 4px;
  201. background-color: @black;
  202. .opacity(0.4);
  203. }
  204. /*Responsive Design*/
  205. @media all and (max-width: 240px) {
  206. #toast-container {
  207. > div {
  208. padding: 8px 8px 8px 50px;
  209. width: 11em;
  210. }
  211. > div.rtl {
  212. padding: 8px 50px 8px 8px;
  213. }
  214. & .toast-close-button {
  215. right: -0.2em;
  216. top: -0.2em;
  217. }
  218. & .rtl .toast-close-button {
  219. left: -0.2em;
  220. right: 0.2em;
  221. }
  222. }
  223. }
  224. @media all and (min-width: 241px) and (max-width: 480px) {
  225. #toast-container {
  226. > div {
  227. padding: 8px 8px 8px 50px;
  228. width: 18em;
  229. }
  230. > div.rtl {
  231. padding: 8px 50px 8px 8px;
  232. }
  233. & .toast-close-button {
  234. right: -0.2em;
  235. top: -0.2em;
  236. }
  237. & .rtl .toast-close-button {
  238. left: -0.2em;
  239. right: 0.2em;
  240. }
  241. }
  242. }
  243. @media all and (min-width: 481px) and (max-width: 768px) {
  244. #toast-container {
  245. > div {
  246. padding: 15px 15px 15px 50px;
  247. width: 25em;
  248. }
  249. > div.rtl {
  250. padding: 15px 50px 15px 15px;
  251. }
  252. }
  253. }