Refine Notifications component (#27005)

This commit is contained in:
Jan Faracik authored and GitHub committed 2026-07-01 08:37:43 +01:00
1 parent 80feb779bf
commit e7eef8d2cf
3 files changed
+26 -62

No files matched your search

@@ -11,15 +11,15 @@ function init() {
defaultAlertClass: "jenkins-notification", defaultAlertClass: "jenkins-notification",
SUCCESS: { SUCCESS: {
alertClass: "jenkins-notification jenkins-notification--success", alertClass: "jenkins-notification jenkins-!-success-color",
icon: Symbols.SUCCESS, icon: Symbols.SUCCESS,
}, },
WARNING: { WARNING: {
alertClass: "jenkins-notification jenkins-notification--warning", alertClass: "jenkins-notification jenkins-!-warning-color",
icon: Symbols.WARNING, icon: Symbols.WARNING,
}, },
ERROR: { ERROR: {
alertClass: "jenkins-notification jenkins-notification--error", alertClass: "jenkins-notification jenkins-!-error-color",
icon: Symbols.ERROR, icon: Symbols.ERROR,
sticky: true, sticky: true,
}, },
+3
View File
@@ -330,6 +330,9 @@ $semantics: (
); );
--item-box-shadow--focus: oklch(from var(--text-color-secondary) l c h / 0.1); --item-box-shadow--focus: oklch(from var(--text-color-secondary) l c h / 0.1);
// Page
--page-inset: 0px;
// Deprecated // Deprecated
--primary: var(--accent-color); // Use var(--accent-color) instead --primary: var(--accent-color); // Use var(--accent-color) instead
--success: var(--green); // Use var(--success-color) instead --success: var(--green); // Use var(--success-color) instead
+20 -59
View File
@@ -1,49 +1,29 @@
@use "sass:color"; @use "../abstracts/mixins";
@use "sass:string";
.jenkins-notification { .jenkins-notification {
@include mixins.overlay-surface($opacity: 75%);
position: fixed; position: fixed;
left: 1.2rem; right: 0;
bottom: 1.2rem; bottom: 0;
min-width: 321px; margin: calc(var(--section-padding) + var(--page-inset));
max-width: min(600px, #{string.unquote("calc(100vw - 2.4rem)")}); width: min(100%, 300px);
max-width: 600px;
display: grid; display: grid;
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
gap: 1.5ch; gap: 0.75rem;
padding: 0.8rem; padding: 0.75rem;
border-radius: var(--form-input-border-radius); border-radius: var(--form-input-border-radius);
font-weight: var(--font-bold-weight); font-weight: var(--font-bold-weight);
line-height: 1.66;
color: var(--text-color); color: var(--text-color);
box-shadow:
0 0 1px 1px rgba(color.adjust(#024cb6, $lightness: -50%), 0.075),
0 10px 30px rgba(color.adjust(#024cb6, $lightness: -50%), 0.25),
0 0 30px 5px var(--background);
will-change: opacity, transform;
z-index: 999; z-index: 999;
cursor: pointer; cursor: pointer;
transition: filter var(--standard-transition); transition: filter var(--standard-transition);
backdrop-filter: brightness(2) blur(30px); transform-origin: bottom right;
svg { svg {
width: 1.4rem; width: 1.375rem;
height: 1.4rem; height: 1.375rem;
}
&::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
z-index: -1;
background: oklch(from var(--background) l c h / 0.3);
border: var(--jenkins-border--subtle);
}
@supports not (backdrop-filter: blur(15px)) {
&::after {
opacity: 0.9;
}
} }
&:hover { &:hover {
@@ -55,30 +35,13 @@
} }
} }
.jenkins-notification--success { .jenkins-notification[class*="color"] {
color: var(--background); background-color: var(--color);
color: var(--background) !important;
// We can't rely on the border from the mixin as on light backgrounds the border looks fuzzy
&::after { &::after {
background-color: var(--success-color); border: 1px solid color-mix(in sRGB, var(--text-color) 10%, transparent);
opacity: 1;
}
}
.jenkins-notification--warning {
color: var(--background);
&::after {
background-color: var(--warning-color);
opacity: 1;
}
}
.jenkins-notification--error {
color: var(--background);
&::after {
background-color: var(--error-color);
opacity: 1;
} }
} }
@@ -98,12 +61,10 @@
@keyframes show-notification { @keyframes show-notification {
from { from {
opacity: 0; opacity: 0;
transform: translateY(1.2rem); transform: translateY(var(--section-padding)) scale(0.95);
} }
to { to {
opacity: 1;
transform: translateY(0);
visibility: visible; visibility: visible;
} }
} }
@@ -111,7 +72,7 @@
@keyframes show-notification-icon { @keyframes show-notification-icon {
from { from {
opacity: 0; opacity: 0;
transform: translateY(0.3rem); transform: translateY(0.5rem);
} }
} }