notifications.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. width: 100%;
  143. }
  144. .notification-cta {
  145. padding-bottom: $spacing-06;
  146. a {
  147. font-weight: 700;
  148. }
  149. a,
  150. button {
  151. white-space: nowrap;
  152. }
  153. }
  154. .notification-disclaimer {
  155. color: var(--notification-disclaimer-color);
  156. font-size: $font-size-sm;
  157. padding-bottom: $spacing-06;
  158. }
  159. .notification-close-btn {
  160. height: $spacing-12;
  161. align-items: center;
  162. display: flex;
  163. padding: 0 0 0 $spacing-06;
  164. button {
  165. aspect-ratio: 1;
  166. border-radius: 50%;
  167. display: flex;
  168. float: right;
  169. padding: 5.5px;
  170. cursor: pointer;
  171. background: transparent;
  172. border: 0;
  173. color: var(--notification-content-primary);
  174. &:hover,
  175. &:focus {
  176. background-color: var(--notification-close-btn-bg);
  177. color: var(--notification-content-secondary);
  178. }
  179. }
  180. }
  181. &.notification-type-info {
  182. background-color: var(--notification-bg-info);
  183. border: 1px solid var(--notification-border-info);
  184. .notification-icon {
  185. color: var(--notification-icon-info);
  186. }
  187. }
  188. &.notification-type-success {
  189. background-color: var(--notification-bg-success);
  190. border: 1px solid var(--notification-border-success);
  191. .notification-icon {
  192. color: var(--notification-icon-success);
  193. }
  194. }
  195. &.notification-type-warning {
  196. background-color: var(--notification-bg-warning);
  197. border: 1px solid var(--notification-border-warning);
  198. .notification-icon {
  199. color: var(--notification-icon-warning);
  200. }
  201. }
  202. &.notification-type-error {
  203. background-color: var(--notification-bg-error);
  204. border: 1px solid var(--notification-border-error);
  205. .notification-icon {
  206. color: var(--notification-icon-error);
  207. }
  208. }
  209. &.notification-type-offer {
  210. background-color: var(--notification-bg-offer);
  211. border: 1px solid var(--notification-border-offer);
  212. .notification-icon {
  213. color: var(--notification-icon-offer);
  214. }
  215. }
  216. @include media-breakpoint-up(md) {
  217. &:not(.notification-cta-below-content) {
  218. .notification-content-and-cta {
  219. flex-wrap: nowrap;
  220. }
  221. .notification-content {
  222. width: auto;
  223. }
  224. .notification-cta {
  225. height: $spacing-12;
  226. padding-left: $spacing-06;
  227. padding-bottom: 0;
  228. align-items: center;
  229. display: flex;
  230. }
  231. }
  232. }
  233. }
  234. .notification-with-scroll-margin {
  235. scroll-margin: $spacing-06;
  236. }
  237. .notification-list {
  238. .notification {
  239. margin-bottom: $spacing-07;
  240. }
  241. }
  242. // Reconfirmation notification
  243. .reconfirm-notification {
  244. display: flex;
  245. width: 100%;
  246. .fa-warning {
  247. margin-right: $spacing-05;
  248. }
  249. .btn-reconfirm {
  250. float: right;
  251. margin-left: $spacing-05;
  252. text-transform: capitalize;
  253. }
  254. }
  255. .group-invitation-cancel-subscription-notification-buttons {
  256. display: flex;
  257. align-items: center;
  258. }
  259. // Settings page
  260. .affiliations-table {
  261. .reconfirm-notification {
  262. margin: 0 auto $spacing-05 !important;
  263. padding: $spacing-07;
  264. }
  265. .reconfirm-row {
  266. td {
  267. border: 0;
  268. .alert {
  269. border: 0;
  270. padding: 0;
  271. }
  272. :not(.alert) {
  273. .reconfirm-notification {
  274. background-color: var(--notification-reconfirmation-bg);
  275. border-radius: $border-radius-base;
  276. .fa-warning {
  277. color: var(--notification-icon-warning);
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. // Only apply bottom margin to form messages when it is non-empty
  285. .form-messages-bottom-margin > :last-child {
  286. margin-bottom: var(--spacing-06);
  287. }