messages.pcss.css

Same filename in this branch
  1. 11.x core/misc/dialog/off-canvas/css/messages.pcss.css
  2. 11.x core/themes/olivero/css/components/messages.pcss.css
Same filename in other branches
  1. 9 core/themes/olivero/css/components/messages.pcss.css
  2. 9 core/themes/claro/css/components/messages.pcss.css
  3. 8.9.x core/themes/claro/css/components/messages.pcss.css
  4. 10 core/misc/dialog/off-canvas/css/messages.pcss.css
  5. 10 core/themes/olivero/css/components/messages.pcss.css
  6. 10 core/themes/claro/css/components/messages.pcss.css
/**
 * Messages.
 *
 * @todo revisit this after https://www.drupal.org/project/drupal/issues/3078400
 *   has been resolved.
 */

:root {
  --messages-bg-color: #353641;
  --messages-fg-color: var(--color-white);
  --messages-border-radius: 2px;
  --messages-border-width: 5px;
  --messages--status-color: #42a877;
  --messages--warning-color: #e0ac00;
  --messages--error-color: #e34f4f;
  --messages__link-color: var(--color-sunglow);
  --messages__link--hover-color: var(--color-white);
  --messages__icon-size: 1rem;
  --messages__text-margin: calc(var(--messages__icon-size) + var(--space-l));
}

.messages-list {
  margin-block: calc(var(--space-m) + var(--space-l));
  padding: 0;
  list-style: none;
}

.field .messages-list,
.form-wrapper .messages-list {
  margin-block-end: 0;
}

.messages {
  overflow: auto; /* Required to prevent text clipping. */
  box-sizing: border-box;
  margin-block: var(--space-m);
  padding-block: var(--space-l) 2rem;
  padding-inline: calc(var(--space-l) - 5px) var(--space-l);
  color: var(--messages-fg-color);
  border-width: 0 0 0 var(--messages-border-width); /* LTR */
  border-style: solid;
  border-color: var(--messages-bg-color);
  border-radius: var(--messages-border-radius);
  background-color: var(--messages-bg-color);

  & a {
    text-decoration: underline;
    color: var(--messages__link-color);

    &:hover {
      color: var(--messages__link--hover-color);
    }
  }

  & pre {
    margin: 0;
  }

  @nest [dir="rtl"] & {
    border-right-width: var(--messages-border-width);
    border-left-width: 0;
  }
}

.messages--error {
  border-color: var(--messages--error-color);

  & .messages__header {
    background: url(../../images/icons/e34f4f/crossout.svg) no-repeat center left;
  }
}

.messages--status {
  border-color: var(--messages--status-color);

  & .messages__header {
    background: url(../../images/icons/42a877/checkmark.svg) no-repeat center left;
  }
}

.messages--warning {
  border-color: var(--messages--warning-color);

  & .messages__header {
    background: url(../../images/icons/e0ac00/exclamation.svg) no-repeat center left;
  }
}

.messages__title {
  margin-block: 0;
  margin-inline: var(--messages__text-margin) 0;
  font-size: var(--font-size-base);
}

.messages__header {
  display: flex;
  align-items: center;
  margin-block-end: var(--space-m);

  @nest [dir="rtl"] & {
    background-position: center right;
  }
}

@media screen and (min-width: 48rem) {
  .messages__content {
    margin-inline-start: var(--messages__text-margin);
  }
}

.messages__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.messages__item + .messages__item {
  margin-block-start: var(--space-s);
}

File

core/themes/claro/css/components/messages.pcss.css

View source
  1. /**
  2. * Messages.
  3. *
  4. * @todo revisit this after https://www.drupal.org/project/drupal/issues/3078400
  5. * has been resolved.
  6. */
  7. :root {
  8. --messages-bg-color: #353641;
  9. --messages-fg-color: var(--color-white);
  10. --messages-border-radius: 2px;
  11. --messages-border-width: 5px;
  12. --messages--status-color: #42a877;
  13. --messages--warning-color: #e0ac00;
  14. --messages--error-color: #e34f4f;
  15. --messages__link-color: var(--color-sunglow);
  16. --messages__link--hover-color: var(--color-white);
  17. --messages__icon-size: 1rem;
  18. --messages__text-margin: calc(var(--messages__icon-size) + var(--space-l));
  19. }
  20. .messages-list {
  21. margin-block: calc(var(--space-m) + var(--space-l));
  22. padding: 0;
  23. list-style: none;
  24. }
  25. .field .messages-list,
  26. .form-wrapper .messages-list {
  27. margin-block-end: 0;
  28. }
  29. .messages {
  30. overflow: auto; /* Required to prevent text clipping. */
  31. box-sizing: border-box;
  32. margin-block: var(--space-m);
  33. padding-block: var(--space-l) 2rem;
  34. padding-inline: calc(var(--space-l) - 5px) var(--space-l);
  35. color: var(--messages-fg-color);
  36. border-width: 0 0 0 var(--messages-border-width); /* LTR */
  37. border-style: solid;
  38. border-color: var(--messages-bg-color);
  39. border-radius: var(--messages-border-radius);
  40. background-color: var(--messages-bg-color);
  41. & a {
  42. text-decoration: underline;
  43. color: var(--messages__link-color);
  44. &:hover {
  45. color: var(--messages__link--hover-color);
  46. }
  47. }
  48. & pre {
  49. margin: 0;
  50. }
  51. @nest [dir="rtl"]
  52. }
  53. .messages--error {
  54. border-color: var(--messages--error-color);
  55. & .messages__header {
  56. background: url(../../images/icons/e34f4f/crossout.svg) no-repeat center left;
  57. }
  58. }
  59. .messages--status {
  60. border-color: var(--messages--status-color);
  61. & .messages__header {
  62. background: url(../../images/icons/42a877/checkmark.svg) no-repeat center left;
  63. }
  64. }
  65. .messages--warning {
  66. border-color: var(--messages--warning-color);
  67. & .messages__header {
  68. background: url(../../images/icons/e0ac00/exclamation.svg) no-repeat center left;
  69. }
  70. }
  71. .messages__title {
  72. margin-block: 0;
  73. margin-inline: var(--messages__text-margin) 0;
  74. font-size: var(--font-size-base);
  75. }
  76. .messages__header {
  77. display: flex;
  78. align-items: center;
  79. margin-block-end: var(--space-m);
  80. @nest [dir="rtl"]
  81. }
  82. @media screen and (min-width: 48rem) {
  83. .messages__content {
  84. margin-inline-start: var(--messages__text-margin);
  85. }
  86. }
  87. .messages__list {
  88. margin: 0;
  89. padding: 0;
  90. list-style: none;
  91. }
  92. .messages__item + .messages__item {
  93. margin-block-start: var(--space-s);
  94. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.