Skip to content

Commit

Permalink
Wrap app bars on smaller screens (jenkinsci#10119)
Browse files Browse the repository at this point in the history
Co-authored-by: Kris Stern <[email protected]>
  • Loading branch information
janfaracik and krisstern authored Jan 9, 2025
1 parent 08ed479 commit b6e5833
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 66 deletions.
59 changes: 0 additions & 59 deletions src/main/scss/base/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -287,65 +287,6 @@ pre.console {
z-index: 998; /* behind top-sticker */
}

.bottom-sticker-inner {
position: relative;
padding: 1em var(--section-padding);
z-index: 0;

&::before {
content: "";
position: absolute;
inset: 0;
background: var(--background);
opacity: 0;
z-index: -1;
}

&::after {
content: "";
position: absolute;
top: -30px;
left: 0;
right: 0;
background: linear-gradient(rgba(black, 0), rgba(#556, 0.075) 110%);
max-width: 100%;
height: 30px;
opacity: 0;
transition: var(--standard-transition);
mask-image: linear-gradient(
to right,
transparent,
white var(--section-padding),
white calc(100% - var(--section-padding)),
transparent
);
pointer-events: none;
}

&--stuck {
.bottom-sticker-inner {
backdrop-filter: blur(15px);

&::before {
opacity: 0.75 !important;

@supports not (backdrop-filter: blur(15px)) {
opacity: 1 !important;
}
}

&::after {
opacity: 1 !important;
}
}
}

.yui-button {
margin-left: 0;
margin-right: 0.5rem;
}
}

.icon16x16 {
width: 16px;
height: 16px;
Expand Down
84 changes: 81 additions & 3 deletions src/main/scss/components/_app-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,50 @@
align-items: center;
justify-content: space-between;
margin-bottom: var(--section-padding);
gap: var(--section-padding);
flex-wrap: wrap;

@media (width <= 800px) {
align-items: stretch;
flex-direction: column;
}

.jenkins-app-bar__content {
display: flex;
justify-content: center;
flex-direction: column;
width: 100%;
min-height: 2.25rem;
flex-grow: 1;
}

.jenkins-app-bar__controls {
display: flex;
align-items: center;
justify-content: center;
margin-left: var(--section-padding);
min-height: 2.25rem;
gap: 0.75rem;

.jenkins-search {
min-width: 260px;
}

@media (width <= 800px) {
justify-content: stretch;
flex-wrap: wrap;

& > * {
flex-grow: 1;
flex-basis: 0;
}

.jenkins-button:first-child {
width: 100%;
flex-basis: auto !important;
}
}

&:empty {
display: none;
}
}

&--sticky {
Expand Down Expand Up @@ -85,3 +109,57 @@
height: 2rem !important;
}
}

.bottom-sticker-inner {
position: relative;
padding: 1em var(--section-padding);
z-index: 0;

&::before {
content: "";
position: absolute;
inset: 0;
background: var(--background);
opacity: 0;
z-index: -1;
}

&::after {
content: "";
position: absolute;
top: -30px;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(#556, 0.075) 110%);
max-width: 100%;
height: 30px;
opacity: 0;
transition: var(--standard-transition);
mask-image: linear-gradient(
to right,
transparent,
white var(--section-padding),
white calc(100% - var(--section-padding)),
transparent
);
pointer-events: none;
}

&--stuck {
.bottom-sticker-inner {
backdrop-filter: blur(15px);

&::before {
opacity: 0.75 !important;

@supports not (backdrop-filter: blur(15px)) {
opacity: 1 !important;
}
}

&::after {
opacity: 1 !important;
}
}
}
}
14 changes: 11 additions & 3 deletions src/main/scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,28 @@
.jenkins-buttons-row {
display: flex;
align-items: center;
gap: 1rem;
gap: 0.75rem;

&--invert {
justify-content: flex-end;
}

&--equal-width {
.jenkins-button {
min-width: 5.625rem;
min-width: 6.5rem;
}
}

&--equal-width {
min-width: 5.625rem;
min-width: 6.5rem;
}

@media (width <= 600px) {
justify-content: stretch;

.jenkins-button {
flex-grow: 1;
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/main/scss/form/_search-bar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../base/breakpoints";

.jenkins-search-container {
position: relative;
}
Expand Down Expand Up @@ -182,9 +184,14 @@
&--app-bar {
--search-bar-height: 3rem;

max-width: 50vw;
width: 100%;
margin-block: -6px;

/* stylelint-disable-next-line media-query-no-invalid */
@media (min-width: breakpoints.$tablet-breakpoint) {
max-width: 50vw;
}

.jenkins-keyboard-shortcut {
right: 0.8125rem;
}
Expand Down

0 comments on commit b6e5833

Please sign in to comment.