Skip to content

Commit

Permalink
Шлифует поле поиска
Browse files Browse the repository at this point in the history
Придумала назвать горячую клавишу словом клавиша, вау
  • Loading branch information
skorobaeus committed May 21, 2024
1 parent 10255ab commit e0c80bb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/includes/blocks/header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% macro devider() %}
<span
class="header__devider font-theme font-theme--code"
class="header__divider font-theme font-theme--code"
aria-hidden="true"
>
</span>
Expand Down Expand Up @@ -68,7 +68,7 @@
{% if not isMainPage %}
<div class="header__hamburger">
<span class="hotkey hotkey--search font-theme font-theme--code">
Поиск <kbd class="hotkey__key">/</kbd>
Клавиша <kbd class="hotkey__key">/</kbd>
</span>
<span class="hotkey hotkey--close font-theme font-theme--code">
<kbd class="hotkey__key">esc</kbd>
Expand Down
4 changes: 2 additions & 2 deletions src/includes/blocks/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
id="search-field"
type="text"
name="query"
placeholder="Что ищете?"
placeholder="Поиск"
aria-keyshortcuts="&#47;"
autocomplete="off"
{% if permalink == isSearchPage %}aria-describedby="search-hint"{% endif %}
Expand All @@ -26,7 +26,7 @@
{# TODO: перенести в header.njk? #}
{% if isMainPage %}
<span class="search__key hotkey hotkey--search">
Поиск <kbd class="hotkey__key">/</kbd>
Клавиша <kbd class="hotkey__key">/</kbd>
</span>
{% endif %}

Expand Down
9 changes: 5 additions & 4 deletions src/styles/blocks/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@
background-color: var(--color-background);
}

.header__devider {
.header__divider {
margin-left: 0.2em;
margin-right: 0.2em;
font-family: var(--font-family);
font-size: 0.85em;
letter-spacing: var(--letter-spacing);
opacity: 0.3;
}

.header__devider::before {
.header__divider::before {
content: "/";
}

Expand Down Expand Up @@ -119,7 +120,7 @@
}

.hotkey--search {
display: inline;
display: none;
}

.header--open .hotkey--search {
Expand All @@ -138,7 +139,7 @@
}

@media (width >= 1024px) {
.hotkey__key {
.hotkey--search, .hotkey__key {
display: inline;
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/blocks/hotkey.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
user-select: none;
}

@media (width <= 1366px) {
.hotkey {
font-size: 18px;
}
}

@media not all and (width >= 768px) {
.hotkey {
display: none;
Expand Down
10 changes: 9 additions & 1 deletion src/styles/blocks/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,28 @@
border: 0;
padding: 0 100px 0 10px;
font: inherit;
letter-spacing: inherit;
line-height: calc(1em + 1px);
letter-spacing: -0.08em;
color: inherit;
outline: none;
border-bottom: 2px solid hsl(0 0% 70%);
background-color: transparent;
}

@media (width >= 1024px) {
.search__input {
padding-inline-start: 0;
}
}

.search__input:focus {
border-bottom-color: var(--color-text);
}

.search__control {
position: relative;
display: grid;
font-size: var(--font-size-l);
}

.search__control > * {
Expand Down

0 comments on commit e0c80bb

Please sign in to comment.