2
0

_messages.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @use '../tools' as *;
  2. // Messages are specific to Django's 'Messaging' system which adds messages into the session,
  3. // for display on the next page visited. These appear as an animated banner at the top of the page.
  4. // For inline help text, see typography.scss
  5. .messages {
  6. position: relative;
  7. background-color: theme('colors.surface-page');
  8. .buttons {
  9. margin-inline-start: 1em;
  10. }
  11. > ul {
  12. @include unlistimmediate();
  13. position: relative;
  14. top: -100px;
  15. opacity: 0;
  16. }
  17. > ul > li {
  18. padding: 1.6em 3em 1.6em 1.6em;
  19. color: theme('colors.text-button');
  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: theme('colors.text-button');
  40. }
  41. }
  42. .error {
  43. background-color: theme('colors.critical.200');
  44. color: theme('colors.white.DEFAULT');
  45. .button:hover {
  46. color: theme('colors.white.DEFAULT');
  47. }
  48. }
  49. .warning {
  50. background-color: theme('colors.warning.100');
  51. color: theme('colors.grey.600');
  52. @include more-contrast() {
  53. background-color: theme('colors.warning.75');
  54. }
  55. }
  56. .info {
  57. background-color: theme('colors.info.100');
  58. color: theme('colors.white.DEFAULT');
  59. }
  60. .success {
  61. background-color: theme('colors.positive.100');
  62. color: theme('colors.white.DEFAULT');
  63. }
  64. .errorlist {
  65. margin: 0.5em 0 0 1em;
  66. }
  67. }
  68. .messages.new > ul {
  69. transition: none;
  70. top: -100px;
  71. }
  72. .ready .messages > ul,
  73. .messages.appear > ul {
  74. transition:
  75. top 0.5s ease,
  76. opacity 0.5s ease,
  77. max-height 1.2s ease;
  78. opacity: 1;
  79. top: 0;
  80. }
  81. @include media-breakpoint-up(sm) {
  82. .messages > ul > li {
  83. padding-inline-start: 1.6em;
  84. padding-inline-end: 3em;
  85. }
  86. }