Skip to content

Commit b6e5833

Browse files
Wrap app bars on smaller screens (jenkinsci#10119)
Co-authored-by: Kris Stern <krisstern@outlook.com>
1 parent 08ed479 commit b6e5833

File tree

4 files changed

+100
-66
lines changed

4 files changed

+100
-66
lines changed

src/main/scss/base/_style.scss

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -287,65 +287,6 @@ pre.console {
287287
z-index: 998; /* behind top-sticker */
288288
}
289289

290-
.bottom-sticker-inner {
291-
position: relative;
292-
padding: 1em var(--section-padding);
293-
z-index: 0;
294-
295-
&::before {
296-
content: "";
297-
position: absolute;
298-
inset: 0;
299-
background: var(--background);
300-
opacity: 0;
301-
z-index: -1;
302-
}
303-
304-
&::after {
305-
content: "";
306-
position: absolute;
307-
top: -30px;
308-
left: 0;
309-
right: 0;
310-
background: linear-gradient(rgba(black, 0), rgba(#556, 0.075) 110%);
311-
max-width: 100%;
312-
height: 30px;
313-
opacity: 0;
314-
transition: var(--standard-transition);
315-
mask-image: linear-gradient(
316-
to right,
317-
transparent,
318-
white var(--section-padding),
319-
white calc(100% - var(--section-padding)),
320-
transparent
321-
);
322-
pointer-events: none;
323-
}
324-
325-
&--stuck {
326-
.bottom-sticker-inner {
327-
backdrop-filter: blur(15px);
328-
329-
&::before {
330-
opacity: 0.75 !important;
331-
332-
@supports not (backdrop-filter: blur(15px)) {
333-
opacity: 1 !important;
334-
}
335-
}
336-
337-
&::after {
338-
opacity: 1 !important;
339-
}
340-
}
341-
}
342-
343-
.yui-button {
344-
margin-left: 0;
345-
margin-right: 0.5rem;
346-
}
347-
}
348-
349290
.icon16x16 {
350291
width: 16px;
351292
height: 16px;

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

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,50 @@
33
align-items: center;
44
justify-content: space-between;
55
margin-bottom: var(--section-padding);
6+
gap: var(--section-padding);
7+
flex-wrap: wrap;
8+
9+
@media (width <= 800px) {
10+
align-items: stretch;
11+
flex-direction: column;
12+
}
613

714
.jenkins-app-bar__content {
815
display: flex;
916
justify-content: center;
1017
flex-direction: column;
11-
width: 100%;
1218
min-height: 2.25rem;
19+
flex-grow: 1;
1320
}
1421

1522
.jenkins-app-bar__controls {
1623
display: flex;
1724
align-items: center;
1825
justify-content: center;
19-
margin-left: var(--section-padding);
20-
min-height: 2.25rem;
2126
gap: 0.75rem;
2227

2328
.jenkins-search {
2429
min-width: 260px;
2530
}
31+
32+
@media (width <= 800px) {
33+
justify-content: stretch;
34+
flex-wrap: wrap;
35+
36+
& > * {
37+
flex-grow: 1;
38+
flex-basis: 0;
39+
}
40+
41+
.jenkins-button:first-child {
42+
width: 100%;
43+
flex-basis: auto !important;
44+
}
45+
}
46+
47+
&:empty {
48+
display: none;
49+
}
2650
}
2751

2852
&--sticky {
@@ -85,3 +109,57 @@
85109
height: 2rem !important;
86110
}
87111
}
112+
113+
.bottom-sticker-inner {
114+
position: relative;
115+
padding: 1em var(--section-padding);
116+
z-index: 0;
117+
118+
&::before {
119+
content: "";
120+
position: absolute;
121+
inset: 0;
122+
background: var(--background);
123+
opacity: 0;
124+
z-index: -1;
125+
}
126+
127+
&::after {
128+
content: "";
129+
position: absolute;
130+
top: -30px;
131+
left: 0;
132+
right: 0;
133+
background: linear-gradient(transparent, rgba(#556, 0.075) 110%);
134+
max-width: 100%;
135+
height: 30px;
136+
opacity: 0;
137+
transition: var(--standard-transition);
138+
mask-image: linear-gradient(
139+
to right,
140+
transparent,
141+
white var(--section-padding),
142+
white calc(100% - var(--section-padding)),
143+
transparent
144+
);
145+
pointer-events: none;
146+
}
147+
148+
&--stuck {
149+
.bottom-sticker-inner {
150+
backdrop-filter: blur(15px);
151+
152+
&::before {
153+
opacity: 0.75 !important;
154+
155+
@supports not (backdrop-filter: blur(15px)) {
156+
opacity: 1 !important;
157+
}
158+
}
159+
160+
&::after {
161+
opacity: 1 !important;
162+
}
163+
}
164+
}
165+
}

src/main/scss/components/_buttons.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,28 @@
162162
.jenkins-buttons-row {
163163
display: flex;
164164
align-items: center;
165-
gap: 1rem;
165+
gap: 0.75rem;
166166

167167
&--invert {
168168
justify-content: flex-end;
169169
}
170170

171171
&--equal-width {
172172
.jenkins-button {
173-
min-width: 5.625rem;
173+
min-width: 6.5rem;
174174
}
175175
}
176176

177177
&--equal-width {
178-
min-width: 5.625rem;
178+
min-width: 6.5rem;
179+
}
180+
181+
@media (width <= 600px) {
182+
justify-content: stretch;
183+
184+
.jenkins-button {
185+
flex-grow: 1;
186+
}
179187
}
180188
}
181189

src/main/scss/form/_search-bar.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../base/breakpoints";
2+
13
.jenkins-search-container {
24
position: relative;
35
}
@@ -182,9 +184,14 @@
182184
&--app-bar {
183185
--search-bar-height: 3rem;
184186

185-
max-width: 50vw;
187+
width: 100%;
186188
margin-block: -6px;
187189

190+
/* stylelint-disable-next-line media-query-no-invalid */
191+
@media (min-width: breakpoints.$tablet-breakpoint) {
192+
max-width: 50vw;
193+
}
194+
188195
.jenkins-keyboard-shortcut {
189196
right: 0.8125rem;
190197
}

0 commit comments

Comments
 (0)