_messages.scss 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. border-bottom: 1px solid transparent;
  21. }
  22. > ul > li:before {
  23. @include font-smoothing;
  24. margin-inline-end: 0.5em;
  25. font-size: 1.5em;
  26. vertical-align: middle;
  27. }
  28. &-icon {
  29. vertical-align: text-top;
  30. margin-inline-end: 0.5em;
  31. width: 1.5em;
  32. height: 1.5em;
  33. }
  34. .button.button-secondary {
  35. border-color: currentColor;
  36. color: inherit;
  37. &:hover {
  38. background-color: transparent;
  39. color: $color-white;
  40. }
  41. }
  42. .error {
  43. background-color: theme('colors.critical.200');
  44. .button:hover {
  45. color: $color-grey-1;
  46. }
  47. }
  48. .warning {
  49. color: $color-grey-1;
  50. background-color: theme('colors.warning.100');
  51. }
  52. .info {
  53. background-color: theme('colors.info.100');
  54. }
  55. .success {
  56. background-color: theme('colors.positive.100');
  57. .button:hover {
  58. background-color: $color-teal-dark;
  59. }
  60. }
  61. .errorlist {
  62. margin: 0.5em 0 0 1em;
  63. }
  64. }
  65. .messages.new > ul {
  66. transition: none;
  67. top: -100px;
  68. }
  69. .ready .messages > ul,
  70. .messages.appear > ul {
  71. transition: top 0.5s ease, opacity 0.5s ease, max-height 1.2s ease;
  72. opacity: 1;
  73. top: 0;
  74. }
  75. @include media-breakpoint-up(sm) {
  76. .messages > ul > li {
  77. padding-inline-start: 1.6em;
  78. padding-inline-end: 3em;
  79. }
  80. }