_messages.scss 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. // For inline help text, see typography.scss
  4. .messages {
  5. position: relative;
  6. background-color: $color-grey-1;
  7. .buttons {
  8. margin-inline-start: 1em;
  9. }
  10. > ul {
  11. @include unlistimmediate();
  12. position: relative;
  13. top: -100px;
  14. opacity: 0;
  15. }
  16. > ul > li {
  17. // @include nice-padding;
  18. padding: 1.6em 3em 1.6em 1.6em;
  19. color: $color-white;
  20. }
  21. > ul > li:before {
  22. @include font-smoothing;
  23. margin-inline-end: 0.5em;
  24. font-size: 1.5em;
  25. vertical-align: middle;
  26. }
  27. &-icon {
  28. vertical-align: text-top;
  29. margin-inline-end: 0.5em;
  30. width: 1.5em;
  31. height: 1.5em;
  32. }
  33. .error {
  34. background-color: theme('colors.critical.200');
  35. }
  36. .warning {
  37. color: $color-grey-1;
  38. background-color: theme('colors.warning.100');
  39. }
  40. .success {
  41. background-color: theme('colors.positive.100');
  42. }
  43. .success .button:hover {
  44. background-color: $color-teal-dark;
  45. }
  46. .button-secondary {
  47. border-color: currentColor;
  48. color: inherit;
  49. &:hover {
  50. border-color: transparent;
  51. color: $color-white;
  52. }
  53. }
  54. .errorlist {
  55. margin: 0.5em 0 0 1em;
  56. }
  57. }
  58. .messages.new > ul {
  59. transition: none;
  60. top: -100px;
  61. }
  62. .ready .messages > ul,
  63. .messages.appear > ul {
  64. transition: top 0.5s ease, opacity 0.5s ease, max-height 1.2s ease;
  65. opacity: 1;
  66. top: 0;
  67. }
  68. @include media-breakpoint-up(sm) {
  69. .messages > ul > li {
  70. padding-inline-start: 1.6em;
  71. padding-inline-end: 3em;
  72. }
  73. }