You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

267 lines
6.7 KiB

  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. &:hover,
  60. &:focus {
  61. color: @black;
  62. text-decoration: none;
  63. cursor: pointer;
  64. .opacity(0.4);
  65. }
  66. }
  67. /*Additional properties for button version
  68. iOS requires the button element instead of an anchor tag.
  69. If you want the anchor version, it requires `href="#"`.*/
  70. button.toast-close-button {
  71. padding: 0;
  72. cursor: pointer;
  73. background: transparent;
  74. border: 0;
  75. -webkit-appearance: none;
  76. }
  77. //#endregion
  78. .toast-top-center {
  79. top: 0;
  80. right: 0;
  81. width: 100%;
  82. }
  83. .toast-bottom-center {
  84. bottom: 0;
  85. right: 0;
  86. width: 100%;
  87. }
  88. .toast-top-full-width {
  89. top: 0;
  90. right: 0;
  91. width: 100%;
  92. }
  93. .toast-bottom-full-width {
  94. bottom: 0;
  95. right: 0;
  96. width: 100%;
  97. }
  98. .toast-top-left {
  99. top: 12px;
  100. left: 12px;
  101. }
  102. .toast-top-right {
  103. top: 12px;
  104. right: 12px;
  105. }
  106. .toast-bottom-right {
  107. right: 12px;
  108. bottom: 12px;
  109. }
  110. .toast-bottom-left {
  111. bottom: 12px;
  112. left: 12px;
  113. }
  114. #toast-container {
  115. position: fixed;
  116. z-index: 999999;
  117. // The container should not be clickable.
  118. pointer-events: none;
  119. * {
  120. -moz-box-sizing: border-box;
  121. -webkit-box-sizing: border-box;
  122. box-sizing: border-box;
  123. }
  124. > div {
  125. position: relative;
  126. // The toast itself should be clickable.
  127. pointer-events: auto;
  128. overflow: hidden;
  129. margin: 0 0 6px;
  130. padding: 15px 15px 15px 50px;
  131. width: 300px;
  132. .borderRadius(3px 3px 3px 3px);
  133. background-position: 15px center;
  134. background-repeat: no-repeat;
  135. .boxShadow(0 0 12px @grey);
  136. color: @white;
  137. .opacity(@default-container-opacity);
  138. }
  139. > :hover {
  140. .boxShadow(0 0 12px @black);
  141. .opacity(1);
  142. cursor: pointer;
  143. }
  144. > .toast-info {
  145. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important;
  146. }
  147. > .toast-error {
  148. 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;
  149. }
  150. > .toast-success {
  151. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important;
  152. }
  153. > .toast-warning {
  154. background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important;
  155. }
  156. /*overrides*/
  157. &.toast-top-center > div,
  158. &.toast-bottom-center > div {
  159. width: 300px;
  160. margin-left: auto;
  161. margin-right: auto;
  162. }
  163. &.toast-top-full-width > div,
  164. &.toast-bottom-full-width > div {
  165. width: 96%;
  166. margin-left: auto;
  167. margin-right: auto;
  168. }
  169. }
  170. .toast {
  171. background-color: @near-black;
  172. }
  173. .toast-success {
  174. background-color: @green;
  175. }
  176. .toast-error {
  177. background-color: @red;
  178. }
  179. .toast-info {
  180. background-color: @blue;
  181. }
  182. .toast-warning {
  183. background-color: @orange;
  184. }
  185. .toast-progress {
  186. position: absolute;
  187. left: 0;
  188. bottom: 0;
  189. height: 4px;
  190. background-color: @black;
  191. .opacity(0.4);
  192. }
  193. /*Responsive Design*/
  194. @media all and (max-width: 240px) {
  195. #toast-container {
  196. > div {
  197. padding: 8px 8px 8px 50px;
  198. width: 11em;
  199. }
  200. & .toast-close-button {
  201. right: -0.2em;
  202. top: -0.2em;
  203. }
  204. }
  205. }
  206. @media all and (min-width: 241px) and (max-width: 480px) {
  207. #toast-container {
  208. > div {
  209. padding: 8px 8px 8px 50px;
  210. width: 18em;
  211. }
  212. & .toast-close-button {
  213. right: -0.2em;
  214. top: -0.2em;
  215. }
  216. }
  217. }
  218. @media all and (min-width: 481px) and (max-width: 768px) {
  219. #toast-container {
  220. > div {
  221. padding: 15px 15px 15px 50px;
  222. width: 25em;
  223. }
  224. }
  225. }