Skip to content

Commit

Permalink
Add keyboard shortcut symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jul 21, 2022
1 parent 1f5c74e commit 83e4b12
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ THE SOFTWARE.
<st:include page="downgrade.jelly" it="${app}" />
</section>

<l:search-bar />

<br />

<j:forEach var="category" items="${app.categorizedManagementLinks.entrySet()}">
<section class="jenkins-section jenkins-section--bottom-padding">
<h2 class="jenkins-section__title">${category.key.label}</h2>
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/resources/lib/layout/search-bar.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ THE SOFTWARE.
autocorrect="off"
autocapitalize="off"
spellcheck="false" />
<div class="jenkins-search__shortcut" tooltip="Press '/' on your keyboard to focus">
<l:icon src="symbol-search-shortcut" />
</div>
</div>
</j:jelly>
40 changes: 39 additions & 1 deletion war/src/main/less/form/search.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

&__input {
appearance: none;
display: block;
background: var(--input-color);
border: 2px solid var(--input-border);
border-radius: var(--form-input-border-radius);
Expand Down Expand Up @@ -109,6 +108,40 @@
}
}

&__shortcut {
position: absolute;
aspect-ratio: 1 / 1;
top: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
aspect-ratio: 1 / 1;
transition: 0.15s ease;
text-align: center;
font-size: 0.75em;
font-weight: 500;
line-height: 1;
color: var(--text-color-secondary);

&::after {
content: "";
position: absolute;
top: calc(50% - 1em);
right: calc(50% - 1em);
width: 2em;
height: 2em;
border: 0.1rem solid var(--item-background--active);
border-radius: 0.3rem;
}

svg {
width: 1.2em;
height: 1.2em;
}
}

&--loading {
.jenkins-search__icon {
svg {
Expand All @@ -134,5 +167,10 @@
.jenkins-search__icon {
fill: var(--focus-input-border);
}
.jenkins-search__shortcut {
opacity: 0;
transform: scale(0.9);
pointer-events: none;
}
}
}
6 changes: 6 additions & 0 deletions war/src/main/resources/images/symbols/search-shortcut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 83e4b12

Please sign in to comment.