_messages.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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: theme('colors.surface-page');
  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. padding: 1.6em 3em 1.6em 1.6em;
  18. color: theme('colors.text-button');
  19. border-bottom: 1px solid transparent;
  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. .button.button-secondary {
  34. border-color: currentColor;
  35. color: inherit;
  36. &:hover {
  37. background-color: transparent;
  38. color: theme('colors.text-button');
  39. }
  40. }
  41. .error {
  42. background-color: theme('colors.critical.200');
  43. color: theme('colors.white.DEFAULT');
  44. .button:hover {
  45. color: theme('colors.white.DEFAULT');
  46. }
  47. }
  48. .warning {
  49. background-color: theme('colors.warning.100');
  50. color: theme('colors.grey.600');
  51. @include more-contrast() {
  52. background-color: theme('colors.warning.75');
  53. }
  54. }
  55. .info {
  56. background-color: theme('colors.info.100');
  57. color: theme('colors.white.DEFAULT');
  58. }
  59. .success {
  60. background-color: theme('colors.positive.100');
  61. color: theme('colors.white.DEFAULT');
  62. }
  63. .errorlist {
  64. margin: 0.5em 0 0 1em;
  65. }
  66. }
  67. .messages.new > ul {
  68. transition: none;
  69. top: -100px;
  70. }
  71. .ready .messages > ul,
  72. .messages.appear > ul {
  73. transition:
  74. top 0.5s ease,
  75. opacity 0.5s ease,
  76. max-height 1.2s ease;
  77. opacity: 1;
  78. top: 0;
  79. }
  80. @include media-breakpoint-up(sm) {
  81. .messages > ul > li {
  82. padding-inline-start: 1.6em;
  83. padding-inline-end: 3em;
  84. }
  85. }