Skip to content

Commit 081dc24

Browse files
authored
Refine bottom app bar appearance (#10853)
2 parents cb214bb + 84bc3ea commit 081dc24

File tree

5 files changed

+48
-52
lines changed

5 files changed

+48
-52
lines changed

core/src/main/resources/lib/form/bottomButtonBar.jelly

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ THE SOFTWARE.
3030
This area will always be visible at the bottom of the screen.
3131
</st:documentation>
3232

33+
<div class="jenkins-bottom-app-bar__shadow"></div>
3334
<div id="bottom-sticker">
3435
<div class="bottom-sticker-inner jenkins-buttons-row jenkins-buttons-row--equal-width">
3536
<d:invokeBody />

src/main/js/widgets/add/addform.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
display: flex;
99
flex-direction: column;
1010
gap: var(--section-padding);
11+
12+
#bottom-sticker {
13+
margin-top: calc(var(--section-padding) * -1);
14+
}
1115
}
1216

1317
.item-copy {

src/main/scss/abstracts/_theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $semantics: (
7979
// App bar
8080
--bottom-app-bar-shadow: color-mix(
8181
in sRGB,
82-
var(--text-color-secondary) 7.5%,
82+
var(--text-color-secondary) 8%,
8383
transparent
8484
);
8585

@@ -116,7 +116,7 @@ $semantics: (
116116
--jenkins-border-width: 1.5px;
117117
--jenkins-border-color: color-mix(
118118
in sRGB,
119-
var(--text-color-secondary) 15%,
119+
var(--text-color-secondary) 17.5%,
120120
var(--card-background)
121121
);
122122
--jenkins-border-color--subtle: color-mix(

src/main/scss/components/_app-bar.scss

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -111,72 +111,63 @@
111111
}
112112
}
113113

114-
.bottom-sticker,
115-
#bottom-sticker {
116-
position: sticky;
117-
118-
// This has to be set to -1px so that IntersectionObserver can add the
119-
// &--stuck class when the element is stuck to the bottom of the screen
120-
// https://css-tricks.com/how-to-detect-when-a-sticky-element-gets-pinned/
121-
bottom: -1px;
122-
margin-left: calc(var(--section-padding) * -1);
123-
width: calc(
124-
100% + calc(var(--section-padding) * 2)
125-
); /* it needs to occupy the entire width or else the underlying content will see through */
114+
$bottom-app-bar-padding: 0.875rem;
126115

127-
z-index: 998; /* behind top-sticker */
128-
}
129-
130-
.bottom-sticker-inner {
131-
position: relative;
132-
padding: 1em var(--section-padding);
133-
z-index: 0;
116+
.jenkins-bottom-app-bar__shadow {
117+
--semi-translucent: color-mix(in sRGB, var(--background) 75%, transparent);
134118

135-
&::before {
136-
content: "";
137-
position: absolute;
138-
inset: 0;
139-
background: var(--background);
140-
opacity: 0;
141-
z-index: -1;
142-
}
119+
position: sticky;
120+
height: calc(
121+
2.375rem + ($bottom-app-bar-padding * 2) + 1px + var(--jenkins-border-width)
122+
);
123+
bottom: -1px;
124+
margin-bottom: calc((2.375rem + $bottom-app-bar-padding) * -1);
125+
backdrop-filter: blur(20px);
126+
background: linear-gradient(
127+
to right,
128+
var(--background),
129+
var(--semi-translucent) 3rem,
130+
var(--semi-translucent) calc(100% - 3rem),
131+
var(--background)
132+
);
133+
border-top: var(--jenkins-border-width) solid var(--jenkins-border-color);
134+
z-index: 997;
143135

144136
&::after {
145137
content: "";
146138
position: absolute;
147-
top: -30px;
148139
left: 0;
149140
right: 0;
150-
background: linear-gradient(transparent, var(--bottom-app-bar-shadow) 110%);
151-
max-width: 100%;
152-
height: 30px;
153-
opacity: 0;
154-
transition: var(--standard-transition);
141+
transition: opacity var(--standard-transition);
142+
top: calc((2rem + var(--jenkins-border-width)) * -1);
143+
height: 2rem;
144+
pointer-events: none;
145+
background: linear-gradient(transparent, var(--bottom-app-bar-shadow));
155146
mask-image: linear-gradient(
156147
to right,
157148
transparent,
158149
white var(--section-padding),
159150
white calc(100% - var(--section-padding)),
160151
transparent
161152
);
162-
pointer-events: none;
153+
opacity: 0;
163154
}
164155

165156
&--stuck {
166-
.bottom-sticker-inner {
167-
backdrop-filter: blur(15px);
168-
169-
&::before {
170-
opacity: 0.75 !important;
171-
172-
@supports not (backdrop-filter: blur(15px)) {
173-
opacity: 1 !important;
174-
}
175-
}
176-
177-
&::after {
178-
opacity: 1 !important;
179-
}
157+
&::after {
158+
opacity: 1 !important;
180159
}
181160
}
182161
}
162+
163+
.bottom-sticker,
164+
#bottom-sticker {
165+
position: sticky;
166+
bottom: 0;
167+
z-index: 998;
168+
}
169+
170+
.bottom-sticker-inner {
171+
position: relative;
172+
padding: $bottom-app-bar-padding 0;
173+
}

war/src/main/webapp/scripts/hudson-behavior.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,12 +1754,12 @@ function rowvgStartEachRow(recursive, f) {
17541754

17551755
window.addEventListener("load", function () {
17561756
// Add a class to the bottom bar when it's stuck to the bottom of the screen
1757-
const el = document.querySelector("#bottom-sticker");
1757+
const el = document.querySelector(".jenkins-bottom-app-bar__shadow");
17581758
if (el) {
17591759
const observer = new IntersectionObserver(
17601760
([e]) =>
17611761
e.target.classList.toggle(
1762-
"bottom-sticker-inner--stuck",
1762+
"jenkins-bottom-app-bar__shadow--stuck",
17631763
e.intersectionRatio < 1,
17641764
),
17651765
{ threshold: [1] },

0 commit comments

Comments
 (0)