notifications.scss 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. @mixin light-notification {
  2. --notification-bg-info: var(--bg-info-03);
  3. --notification-bg-success: var(--bg-accent-03);
  4. --notification-bg-warning: var(--bg-warning-03);
  5. --notification-bg-error: var(--bg-danger-03);
  6. --notification-bg-offer: var(--bg-light-primary);
  7. --notification-border-info: var(--blue-20);
  8. --notification-border-success: var(--green-20);
  9. --notification-border-warning: var(--yellow-20);
  10. --notification-border-error: var(--red-20);
  11. --notification-border-offer: var(--neutral-20);
  12. --notification-icon-info: var(--blue-50);
  13. --notification-icon-success: var(--green-50);
  14. --notification-icon-warning: var(--yellow-40);
  15. --notification-icon-error: var(--red-50);
  16. --notification-icon-offer: var(--neutral-50);
  17. --notification-content-primary: var(--content-primary);
  18. --notification-content-secondary: var(--content-secondary);
  19. --notification-bg-primary: var(--neutral-90);
  20. --notification-reconfirmation-bg: var(--bg-light-secondary);
  21. --notification-disclaimer-color: var(--neutral-60);
  22. --notification-close-btn-bg: rgb(27 34 44 / 8%);
  23. }
  24. @mixin dark-notification {
  25. --notification-bg-info: var(--blue-70);
  26. --notification-bg-success: var(--green-70);
  27. --notification-bg-warning: var(--yellow-70);
  28. --notification-bg-error: var(--red-70);
  29. --notification-bg-offer: var(--neutral-70);
  30. --notification-border-info: var(--blue-60);
  31. --notification-border-success: var(--green-60);
  32. --notification-border-warning: var(--yellow-60);
  33. --notification-border-error: var(--red-60);
  34. --notification-border-offer: var(--neutral-60);
  35. --notification-icon-info: var(--blue-30);
  36. --notification-icon-success: var(--green-30);
  37. --notification-icon-warning: var(--yellow-20);
  38. --notification-icon-error: var(--red-20);
  39. --notification-icon-offer: var(--neutral-20);
  40. --notification-content-primary: var(--content-primary-dark);
  41. --notification-content-secondary: var(--content-secondary-dark);
  42. --notification-bg-primary: var(--neutral-10);
  43. --notification-reconfirmation-bg: var(--bg-dark-secondary);
  44. --notification-disclaimer-color: var(--neutral-40);
  45. --notification-close-btn-bg: rgb(255 255 255 / 8%);
  46. }
  47. :root {
  48. @include light-notification;
  49. @include theme('default') {
  50. .project-ds-nav-page {
  51. .notification {
  52. @include dark-notification;
  53. @include dark-bg;
  54. }
  55. }
  56. }
  57. }
  58. .notification-body {
  59. // will be deprecated once notifications moved to use .notification (see below)
  60. flex-grow: 1;
  61. width: 90%;
  62. @include media-breakpoint-up(md) {
  63. width: auto;
  64. }
  65. }
  66. .notification-action {
  67. $line-height-computed: $font-size-base * $line-height-base; // 24px
  68. // will be deprecated once notifications moved to use .notification (see below)
  69. margin-top: calc($line-height-computed / 2); // match paragraph padding
  70. order: 1;
  71. @include media-breakpoint-up(md) {
  72. margin-top: 0;
  73. order: 0;
  74. padding-left: $spacing-05;
  75. }
  76. }
  77. .notification-close {
  78. // will be deprecated once notifications moved to use .notification (see below)
  79. padding-left: $spacing-05;
  80. text-align: right;
  81. width: 10%;
  82. button {
  83. aspect-ratio: 1;
  84. border-radius: 50%;
  85. display: flex;
  86. float: right;
  87. padding: 5.5px;
  88. cursor: pointer;
  89. background: transparent;
  90. border: 0;
  91. &:hover,
  92. &:focus {
  93. background-color: var(--notification-close-btn-bg);
  94. color: var(--notification-content-secondary);
  95. }
  96. }
  97. @include media-breakpoint-up(md) {
  98. width: auto;
  99. }
  100. }
  101. .notification {
  102. border-radius: $border-radius-base;
  103. color: var(--notification-content-primary);
  104. display: flex;
  105. padding: 0 $spacing-06; // vertical padding added by elements within notification
  106. width: 100%;
  107. a:not(.btn) {
  108. text-decoration: underline;
  109. }
  110. p {
  111. margin-bottom: $spacing-02;
  112. }
  113. .notification-icon {
  114. flex-grow: 0;
  115. padding: 18px $spacing-06 0 0;
  116. }
  117. .notification-icon.notification-icon-center {
  118. padding-top: 0;
  119. display: flex;
  120. align-items: center;
  121. }
  122. .notification-content-and-cta {
  123. // shared container to align cta with text on smaller screens
  124. display: flex;
  125. flex-grow: 1;
  126. flex-wrap: wrap;
  127. p:last-child {
  128. margin-bottom: 0;
  129. }
  130. }
  131. .notification-content {
  132. flex-grow: 1;
  133. padding: $spacing-06 0;
  134. width: 100%;
  135. }
  136. .notification-cta {
  137. padding-bottom: $spacing-06;
  138. a {
  139. font-weight: 700;
  140. }
  141. a,
  142. button {
  143. white-space: nowrap;
  144. }
  145. }
  146. .notification-disclaimer {
  147. color: var(--notification-disclaimer-color);
  148. font-size: $font-size-sm;
  149. padding-bottom: $spacing-06;
  150. }
  151. .notification-close-btn {
  152. height: $spacing-12;
  153. align-items: center;
  154. display: flex;
  155. padding: 0 0 0 $spacing-06;
  156. button {
  157. aspect-ratio: 1;
  158. border-radius: 50%;
  159. display: flex;
  160. float: right;
  161. padding: 5.5px;
  162. cursor: pointer;
  163. background: transparent;
  164. border: 0;
  165. color: var(--notification-content-primary);
  166. &:hover,
  167. &:focus {
  168. background-color: var(--notification-close-btn-bg);
  169. color: var(--notification-content-secondary);
  170. }
  171. }
  172. }
  173. &.notification-type-info {
  174. background-color: var(--notification-bg-info);
  175. border: 1px solid var(--notification-border-info);
  176. .notification-icon {
  177. color: var(--notification-icon-info);
  178. }
  179. }
  180. &.notification-type-success {
  181. background-color: var(--notification-bg-success);
  182. border: 1px solid var(--notification-border-success);
  183. .notification-icon {
  184. color: var(--notification-icon-success);
  185. }
  186. }
  187. &.notification-type-warning {
  188. background-color: var(--notification-bg-warning);
  189. border: 1px solid var(--notification-border-warning);
  190. .notification-icon {
  191. color: var(--notification-icon-warning);
  192. }
  193. }
  194. &.notification-type-error {
  195. background-color: var(--notification-bg-error);
  196. border: 1px solid var(--notification-border-error);
  197. .notification-icon {
  198. color: var(--notification-icon-error);
  199. }
  200. }
  201. &.notification-type-offer {
  202. background-color: var(--notification-bg-offer);
  203. border: 1px solid var(--notification-border-offer);
  204. .notification-icon {
  205. color: var(--notification-icon-offer);
  206. }
  207. }
  208. @include media-breakpoint-up(md) {
  209. &:not(.notification-cta-below-content) {
  210. .notification-content-and-cta {
  211. flex-wrap: nowrap;
  212. }
  213. .notification-content {
  214. width: auto;
  215. }
  216. .notification-cta {
  217. height: $spacing-12;
  218. padding-left: $spacing-06;
  219. padding-bottom: 0;
  220. align-items: center;
  221. display: flex;
  222. }
  223. }
  224. }
  225. }
  226. .notification-with-scroll-margin {
  227. scroll-margin: $spacing-06;
  228. }
  229. .notification-list {
  230. .notification {
  231. margin-bottom: $spacing-07;
  232. }
  233. }
  234. // Reconfirmation notification
  235. .reconfirm-notification {
  236. display: flex;
  237. width: 100%;
  238. .fa-warning {
  239. margin-right: $spacing-05;
  240. }
  241. .btn-reconfirm {
  242. float: right;
  243. margin-left: $spacing-05;
  244. text-transform: capitalize;
  245. }
  246. }
  247. .group-invitation-cancel-subscription-notification-buttons {
  248. display: flex;
  249. align-items: center;
  250. }
  251. // Settings page
  252. .affiliations-table {
  253. .reconfirm-notification {
  254. margin: 0 auto $spacing-05 !important;
  255. padding: $spacing-07;
  256. }
  257. .reconfirm-row {
  258. td {
  259. border: 0;
  260. .alert {
  261. border: 0;
  262. padding: 0;
  263. }
  264. :not(.alert) {
  265. .reconfirm-notification {
  266. background-color: var(--notification-reconfirmation-bg);
  267. border-radius: $border-radius-base;
  268. .fa-warning {
  269. color: var(--notification-icon-warning);
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. // Only apply bottom margin to form messages when it is non-empty
  277. .form-messages-bottom-margin > :last-child {
  278. margin-bottom: var(--spacing-06);
  279. }