_messages.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Messages are specific to Django's 'Messaging' system which adds messages into the session,
  2. // for display on the next page visited. These appear as an animated banner at the top of the page.
  3. //
  4. // For inline help text, see typography.scss
  5. .messages {
  6. position: relative;
  7. z-index: 5;
  8. background-color: $color-grey-1;
  9. .buttons {
  10. margin-left: 1em;
  11. }
  12. > ul {
  13. @include unlistimmediate();
  14. position: relative;
  15. top: -100px;
  16. opacity: 0;
  17. }
  18. > ul > li {
  19. // @include nice-padding;
  20. padding: 1.6em 3em 1.6em 1.6em;
  21. color: $color-white;
  22. }
  23. > ul > li:before {
  24. @include font-smoothing;
  25. margin-right: 0.5em;
  26. font-size: 1.5em;
  27. vertical-align: middle;
  28. }
  29. .error {
  30. background-color: $color-red-dark;
  31. &:before {
  32. font-family: wagtail;
  33. content: map-get($icons, 'warning');
  34. }
  35. }
  36. .warning {
  37. background-color: $color-orange-dark;
  38. &:before {
  39. font-family: wagtail;
  40. content: map-get($icons, 'warning');
  41. }
  42. }
  43. .success {
  44. background-color: $color-green-dark;
  45. &:before {
  46. font-family: wagtail;
  47. content: map-get($icons, 'success');
  48. }
  49. }
  50. .success .button:hover {
  51. background-color: $color-teal-dark;
  52. }
  53. .button-secondary {
  54. border-color: rgba(255, 255, 255, 0.5);
  55. color: $color-white;
  56. &:hover {
  57. border-color: transparent;
  58. }
  59. }
  60. .errorlist {
  61. margin: 0.5em 0 0 1em;
  62. }
  63. }
  64. .messages.new > ul {
  65. transition: none;
  66. top: -100px;
  67. }
  68. .ready .messages > ul,
  69. .messages.appear > ul {
  70. transition: top 0.5s ease, opacity 0.5s ease, max-height 1.2s ease;
  71. opacity: 1;
  72. top: 0;
  73. }
  74. @include media-breakpoint-up(sm) {
  75. .messages > ul > li {
  76. padding-left: 1.6em;
  77. padding-right: 3em;
  78. }
  79. }