notifications.scss 7.9 KB

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