messages.pcss.css

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

@import "../base/variables.pcss.css";

: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-top: calc(var(--space-m) + var(--space-l));
  margin-bottom: calc(var(--space-m) + var(--space-l));
  padding: 0;
  list-style: none;
}

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

.messages {
  overflow: auto; /* Required to prevent text clipping. */
  box-sizing: border-box;
  margin-top: var(--space-m);
  margin-bottom: var(--space-m);
  padding: var(--space-l) var(--space-l) 2rem calc(var(--space-l) - 5px); /* LTR */
  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);
}

[dir="rtl"] .messages {
  padding-right: calc(var(--space-l) - 5px);
  padding-left: var(--space-l);
  border-right-width: var(--messages-border-width);
  border-left-width: 0;
}

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

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

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

.messages__title {
  margin: 0 0 0 var(--messages__text-margin); /* LTR */
  font-size: var(--font-size-base);
}
[dir="rtl"] .messages__title {
  margin-right: var(--messages__text-margin);
  margin-left: 0;
}

.messages--error .messages__header {
  background: url(../../images/icons/e34f4f/crossout.svg) no-repeat center left; /* LTR */
}
[dir="rtl"] .messages--error .messages__header {
  background-position: center right;
}

.messages--status .messages__header {
  background: url(../../images/icons/42a877/checkmark.svg) no-repeat center left; /* LTR */
}
[dir="rtl"] .messages--status .messages__header {
  background-position: center right;
}

.messages--warning .messages__header {
  background: url(../../images/icons/e0ac00/exclamation.svg) no-repeat center left; /* LTR */
}
[dir="rtl"] .messages--warning .messages__header {
  background-position: center right;
}

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

@media screen and (min-width: 48rem) {
  .messages__content {
    margin-left: var(--messages__text-margin); /* LTR */
  }

  [dir="rtl"] .messages__content {
    margin-right: var(--messages__text-margin);
    margin-left: 0;
  }
}

.messages a {
  text-decoration: underline;
  color: var(--messages__link-color);
}

.messages a:hover {
  color: var(--messages__link--hover-color);
}

.messages pre {
  margin: 0;
}

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

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

@media screen and (-ms-high-contrast: active) {
  .messages {
    border-width: 1px 1px 1px var(--messages-border-width); /* LTR */
  }
  [dir="rtl"] .messages {
    border-right-width: var(--messages-border-width);
    border-left-width: 1px;
  }
  .messages__header {
    filter: grayscale(1) brightness(1.5) contrast(10);
  }
}

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. @import "../base/variables.pcss.css";
  8. :root {
  9. --messages-bg-color: #353641;
  10. --messages-fg-color: var(--color-white);
  11. --messages-border-radius: 2px;
  12. --messages-border-width: 5px;
  13. --messages--status-color: #42a877;
  14. --messages--warning-color: #e0ac00;
  15. --messages--error-color: #e34f4f;
  16. --messages__link-color: var(--color-sunglow);
  17. --messages__link--hover-color: var(--color-white);
  18. --messages__icon-size: 1rem;
  19. --messages__text-margin: calc(var(--messages__icon-size) + var(--space-l));
  20. }
  21. .messages-list {
  22. margin-top: calc(var(--space-m) + var(--space-l));
  23. margin-bottom: calc(var(--space-m) + var(--space-l));
  24. padding: 0;
  25. list-style: none;
  26. }
  27. .field .messages-list,
  28. .form-wrapper .messages-list {
  29. margin-bottom: 0;
  30. }
  31. .messages {
  32. overflow: auto; /* Required to prevent text clipping. */
  33. box-sizing: border-box;
  34. margin-top: var(--space-m);
  35. margin-bottom: var(--space-m);
  36. padding: var(--space-l) var(--space-l) 2rem calc(var(--space-l) - 5px); /* LTR */
  37. color: var(--messages-fg-color);
  38. border-width: 0 0 0 var(--messages-border-width); /* LTR */
  39. border-style: solid;
  40. border-color: var(--messages-bg-color);
  41. border-radius: var(--messages-border-radius);
  42. background-color: var(--messages-bg-color);
  43. }
  44. [dir="rtl"] .messages {
  45. padding-right: calc(var(--space-l) - 5px);
  46. padding-left: var(--space-l);
  47. border-right-width: var(--messages-border-width);
  48. border-left-width: 0;
  49. }
  50. .messages--error {
  51. border-color: var(--messages--error-color);
  52. }
  53. .messages--status {
  54. border-color: var(--messages--status-color);
  55. }
  56. .messages--warning {
  57. border-color: var(--messages--warning-color);
  58. }
  59. .messages__title {
  60. margin: 0 0 0 var(--messages__text-margin); /* LTR */
  61. font-size: var(--font-size-base);
  62. }
  63. [dir="rtl"] .messages__title {
  64. margin-right: var(--messages__text-margin);
  65. margin-left: 0;
  66. }
  67. .messages--error .messages__header {
  68. background: url(../../images/icons/e34f4f/crossout.svg) no-repeat center left; /* LTR */
  69. }
  70. [dir="rtl"] .messages--error .messages__header {
  71. background-position: center right;
  72. }
  73. .messages--status .messages__header {
  74. background: url(../../images/icons/42a877/checkmark.svg) no-repeat center left; /* LTR */
  75. }
  76. [dir="rtl"] .messages--status .messages__header {
  77. background-position: center right;
  78. }
  79. .messages--warning .messages__header {
  80. background: url(../../images/icons/e0ac00/exclamation.svg) no-repeat center left; /* LTR */
  81. }
  82. [dir="rtl"] .messages--warning .messages__header {
  83. background-position: center right;
  84. }
  85. .messages__header {
  86. display: flex;
  87. align-items: center;
  88. margin-bottom: var(--space-m);
  89. }
  90. @media screen and (min-width: 48rem) {
  91. .messages__content {
  92. margin-left: var(--messages__text-margin); /* LTR */
  93. }
  94. [dir="rtl"] .messages__content {
  95. margin-right: var(--messages__text-margin);
  96. margin-left: 0;
  97. }
  98. }
  99. .messages a {
  100. text-decoration: underline;
  101. color: var(--messages__link-color);
  102. }
  103. .messages a:hover {
  104. color: var(--messages__link--hover-color);
  105. }
  106. .messages pre {
  107. margin: 0;
  108. }
  109. .messages__list {
  110. margin: 0;
  111. padding: 0;
  112. list-style: none;
  113. }
  114. .messages__item + .messages__item {
  115. margin-top: var(--space-s);
  116. }
  117. @media screen and (-ms-high-contrast: active) {
  118. .messages {
  119. border-width: 1px 1px 1px var(--messages-border-width); /* LTR */
  120. }
  121. [dir="rtl"] .messages {
  122. border-right-width: var(--messages-border-width);
  123. border-left-width: 1px;
  124. }
  125. .messages__header {
  126. filter: grayscale(1) brightness(1.5) contrast(10);
  127. }
  128. }

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