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. 10 core/misc/dialog/off-canvas/css/messages.pcss.css
  4. 10 core/themes/olivero/css/components/messages.pcss.css
  5. 10 core/themes/claro/css/components/messages.pcss.css
  6. 11.x core/misc/dialog/off-canvas/css/messages.pcss.css
  7. 11.x core/themes/olivero/css/components/messages.pcss.css
  8. 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 {
  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("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 14 14'%3E%3Cpath d='M3 11.1931L11.4501 2.99995' stroke='%23e34f4f' stroke-width='2'/%3E%3Ccircle cx='7' cy='7' r='6' fill='none' stroke='%23e34f4f' stroke-width='2'/%3E%3C/svg%3E%0A") no-repeat center left; /* LTR */
}
[dir="rtl"] .messages--error .messages__header {
  background-position: center right;
}

.messages--status .messages__header {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 13'%3E%3Cpath d='M2 6.57143L5.6 10L14 2' fill='none' stroke='%2342a877' stroke-width='3'/%3E%3C/svg%3E%0A") no-repeat center left; /* LTR */
}
[dir="rtl"] .messages--status .messages__header {
  background-position: center right;
}

.messages--warning .messages__header {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 4 14' fill='%23e0ac00'%3E%3Crect x='0.5' width='3' height='9'/%3E%3Ccircle cx='2' cy='12.5' r='1.5'/%3E%3C/svg%3E%0A") 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. box-sizing: border-box;
  33. margin-top: var(--space-m);
  34. margin-bottom: var(--space-m);
  35. padding: var(--space-l) var(--space-l) 2rem calc(var(--space-l) - 5px); /* LTR */
  36. color: var(--messages-fg-color);
  37. border-width: 0 0 0 var(--messages-border-width); /* LTR */
  38. border-style: solid;
  39. border-color: var(--messages-bg-color);
  40. border-radius: var(--messages-border-radius);
  41. background-color: var(--messages-bg-color);
  42. }
  43. [dir="rtl"] .messages {
  44. padding-right: calc(var(--space-l) - 5px);
  45. padding-left: var(--space-l);
  46. border-right-width: var(--messages-border-width);
  47. border-left-width: 0;
  48. }
  49. .messages--error {
  50. border-color: var(--messages--error-color);
  51. }
  52. .messages--status {
  53. border-color: var(--messages--status-color);
  54. }
  55. .messages--warning {
  56. border-color: var(--messages--warning-color);
  57. }
  58. .messages__title {
  59. margin: 0 0 0 var(--messages__text-margin); /* LTR */
  60. font-size: var(--font-size-base);
  61. }
  62. [dir="rtl"] .messages__title {
  63. margin-right: var(--messages__text-margin);
  64. margin-left: 0;
  65. }
  66. .messages--error .messages__header {
  67. background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 14 14'%3E%3Cpath d='M3 11.1931L11.4501 2.99995' stroke='%23e34f4f' stroke-width='2'/%3E%3Ccircle cx='7' cy='7' r='6' fill='none' stroke='%23e34f4f' stroke-width='2'/%3E%3C/svg%3E%0A") no-repeat center left; /* LTR */
  68. }
  69. [dir="rtl"] .messages--error .messages__header {
  70. background-position: center right;
  71. }
  72. .messages--status .messages__header {
  73. background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 13'%3E%3Cpath d='M2 6.57143L5.6 10L14 2' fill='none' stroke='%2342a877' stroke-width='3'/%3E%3C/svg%3E%0A") no-repeat center left; /* LTR */
  74. }
  75. [dir="rtl"] .messages--status .messages__header {
  76. background-position: center right;
  77. }
  78. .messages--warning .messages__header {
  79. background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 4 14' fill='%23e0ac00'%3E%3Crect x='0.5' width='3' height='9'/%3E%3Ccircle cx='2' cy='12.5' r='1.5'/%3E%3C/svg%3E%0A") no-repeat center left; /* LTR */
  80. }
  81. [dir="rtl"] .messages--warning .messages__header {
  82. background-position: center right;
  83. }
  84. .messages__header {
  85. display: flex;
  86. align-items: center;
  87. margin-bottom: var(--space-m);
  88. }
  89. @media screen and (min-width: 48rem) {
  90. .messages__content {
  91. margin-left: var(--messages__text-margin); /* LTR */
  92. }
  93. [dir="rtl"] .messages__content {
  94. margin-right: var(--messages__text-margin);
  95. margin-left: 0;
  96. }
  97. }
  98. .messages a {
  99. text-decoration: underline;
  100. color: var(--messages__link-color);
  101. }
  102. .messages a:hover {
  103. color: var(--messages__link--hover-color);
  104. }
  105. .messages pre {
  106. margin: 0;
  107. }
  108. .messages__list {
  109. margin: 0;
  110. padding: 0;
  111. list-style: none;
  112. }
  113. .messages__item + .messages__item {
  114. margin-top: var(--space-s);
  115. }
  116. @media screen and (-ms-high-contrast: active) {
  117. .messages {
  118. border-width: 1px 1px 1px var(--messages-border-width); /* LTR */
  119. }
  120. [dir="rtl"] .messages {
  121. border-right-width: var(--messages-border-width);
  122. border-left-width: 1px;
  123. }
  124. .messages__header {
  125. filter: grayscale(1) brightness(1.5) contrast(10);
  126. }
  127. }

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