toastr.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /**
  2. * UI v1.0.0
  3. * Copyright 2015-2017 Muyao
  4. * Licensed under the Muyao License 1.0
  5. */
  6. .toast-title {
  7. font-weight: 700;
  8. }
  9. .toast-message {
  10. -ms-word-wrap: break-word;
  11. word-wrap: break-word;
  12. }
  13. .toast-message a, .toast-message label {
  14. color: #fff;
  15. }
  16. .toast-message a:hover {
  17. color: #ccd5db;
  18. text-decoration: none;
  19. }
  20. .toast-close-button {
  21. position: relative;
  22. top: -.3em;
  23. right: -.3em;
  24. float: right;
  25. margin-bottom: -.5em;
  26. font-size: 20px;
  27. font-weight: 400;
  28. color: #fff;
  29. text-shadow: 0 1px 0 #fff;
  30. filter: alpha(opacity=80);
  31. opacity: .8;
  32. -webkit-text-shadow: 0 1px 0 #fff;
  33. }
  34. .toast-close-button:hover, .toast-close-button:focus {
  35. color: #000;
  36. text-decoration: none;
  37. cursor: pointer;
  38. filter: alpha(opacity=40);
  39. opacity: .4;
  40. }
  41. button.toast-close-button {
  42. -webkit-appearance: none;
  43. padding: 0;
  44. cursor: pointer;
  45. background: transparent;
  46. border: 0;
  47. }
  48. .toast-top-center {
  49. top: 12px;
  50. right: 0;
  51. width: 100%;
  52. }
  53. .toast-bottom-center {
  54. right: 0;
  55. bottom: 12px;
  56. width: 100%;
  57. }
  58. .toast-top-full-width {
  59. top: 0;
  60. right: 0;
  61. width: 100%;
  62. }
  63. .toast-top-full-width .toast {
  64. margin-bottom: 0;
  65. }
  66. .toast-bottom-full-width {
  67. right: 0;
  68. bottom: 0;
  69. width: 100%;
  70. }
  71. .toast-bottom-full-width .toast {
  72. margin-bottom: 0 !important;
  73. }
  74. .toast-top-left {
  75. top: 12px;
  76. left: 12px;
  77. }
  78. .toast-top-right {
  79. top: 12px;
  80. right: 12px;
  81. }
  82. .toast-bottom-right {
  83. right: 12px;
  84. bottom: 12px;
  85. }
  86. .toast-bottom-left {
  87. bottom: 12px;
  88. left: 12px;
  89. }
  90. [class^="toast-"][aria-live="polite"] {
  91. position: fixed;
  92. z-index: 1991050199;
  93. pointer-events: none;
  94. /* 覆盖 */
  95. }
  96. [class^="toast-"][aria-live="polite"] * {
  97. -webkit-box-sizing: border-box;
  98. -moz-box-sizing: border-box;
  99. box-sizing: border-box;
  100. }
  101. [class^="toast-"][aria-live="polite"] > div {
  102. position: relative;
  103. width: 300px;
  104. padding: 10px 15px;
  105. margin: 0 0 6px;
  106. overflow: hidden;
  107. color: #a3afb7;
  108. pointer-events: auto;
  109. filter: alpha(opacity=95);
  110. background-repeat: no-repeat;
  111. background-position: 15px center;
  112. border: 1px solid transparent;
  113. border-radius: 3px;
  114. opacity: .95;
  115. }
  116. [class^="toast-"][aria-live="polite"] > .toast-shadow {
  117. -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .23);
  118. box-shadow: 0 1px 3px rgba(0, 0, 0, .23);
  119. }
  120. [class^="toast-"][aria-live="polite"] > .toast-shadow:hover {
  121. -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, .23);
  122. box-shadow: 0 1px 6px rgba(0, 0, 0, .23);
  123. }
  124. [class^="toast-"][aria-live="polite"] > :hover {
  125. cursor: pointer;
  126. filter: alpha(opacity=100);
  127. opacity: 1;
  128. }
  129. [class^="toast-"][aria-live="polite"] > .toast-success:not(.toast-just-text), [class^="toast-"][aria-live="polite"] > .toast-info:not(.toast-just-text), [class^="toast-"][aria-live="polite"] > .toast-warning:not(.toast-just-text), [class^="toast-"][aria-live="polite"] > .toast-error:not(.toast-just-text) {
  130. padding-left: 50px;
  131. }
  132. [class^="toast-"][aria-live="polite"] > .toast-success:not(.toast-just-text):before, [class^="toast-"][aria-live="polite"] > .toast-info:not(.toast-just-text):before, [class^="toast-"][aria-live="polite"] > .toast-warning:not(.toast-just-text):before, [class^="toast-"][aria-live="polite"] > .toast-error:not(.toast-just-text):before {
  133. position: absolute;
  134. top: 50%;
  135. left: 12px;
  136. font-family: "FontAwesome";
  137. font-size: 30px;
  138. font-style: normal;
  139. font-weight: 400;
  140. -webkit-transform: translate(0, -50%);
  141. -ms-transform: translate(0, -50%);
  142. -o-transform: translate(0, -50%);
  143. transform: translate(0, -50%);
  144. text-rendering: auto;
  145. speak: none;
  146. -webkit-font-smoothing: antialiased;
  147. -moz-osx-font-smoothing: grayscale;
  148. }
  149. [class^="toast-"][aria-live="polite"] > .toast-success {
  150. color: #fff;
  151. }
  152. [class^="toast-"][aria-live="polite"] > .toast-success:not(.toast-just-text):before {
  153. content: "\f00c";
  154. }
  155. [class^="toast-"][aria-live="polite"] > .toast-info {
  156. color: #fff;
  157. }
  158. [class^="toast-"][aria-live="polite"] > .toast-info:not(.toast-just-text):before {
  159. content: "\f05a";
  160. }
  161. [class^="toast-"][aria-live="polite"] > .toast-warning {
  162. color: #fff;
  163. }
  164. [class^="toast-"][aria-live="polite"] > .toast-warning:not(.toast-just-text):before {
  165. content: "\f071";
  166. }
  167. [class^="toast-"][aria-live="polite"] > .toast-error {
  168. color: #fff;
  169. }
  170. [class^="toast-"][aria-live="polite"] > .toast-error:not(.toast-just-text):before {
  171. content: "\f056";
  172. }
  173. [class^="toast-"][aria-live="polite"].toast-top-center > div, [class^="toast-"][aria-live="polite"].toast-bottom-center > div {
  174. width: 300px;
  175. margin-right: auto;
  176. margin-left: auto;
  177. }
  178. [class^="toast-"][aria-live="polite"].toast-top-full-width > div, [class^="toast-"][aria-live="polite"].toast-bottom-full-width > div {
  179. width: 100%;
  180. margin-right: auto;
  181. margin-left: auto;
  182. border-radius: 0;
  183. }
  184. .toast {
  185. background-color: #e4eaee;
  186. }
  187. .toast-success {
  188. background-color: #5cd29d;
  189. }
  190. .toast-error {
  191. background-color: #fa7a7a;
  192. }
  193. .toast-info {
  194. background-color: #77d6e1;
  195. }
  196. .toast-warning {
  197. background-color: #f4b066;
  198. }
  199. .toast-progress {
  200. position: absolute;
  201. bottom: 0;
  202. left: 0;
  203. height: 4px;
  204. background-color: #000;
  205. filter: alpha(opacity=10);
  206. opacity: .1;
  207. }
  208. /* 响应式设计 */
  209. @media all and (max-width: 240px) {
  210. [class^="toast-"][aria-live="polite"] > div {
  211. width: 11em;
  212. padding: 8px 8px 8px 50px;
  213. }
  214. [class^="toast-"][aria-live="polite"] .toast-close-button {
  215. top: -.2em;
  216. right: -.2em;
  217. }
  218. }
  219. @media all and (min-width: 241px) and (max-width: 480px) {
  220. [class^="toast-"][aria-live="polite"] > div {
  221. width: 18em;
  222. padding: 8px 8px 8px 50px;
  223. }
  224. [class^="toast-"][aria-live="polite"] .toast-close-button {
  225. top: -.2em;
  226. right: -.2em;
  227. }
  228. }
  229. @media all and (min-width: 481px) and (max-width: 768px) {
  230. [class^="toast-"][aria-live="polite"] > div {
  231. width: 25em;
  232. padding: 15px 15px 15px 50px;
  233. }
  234. }