feat(ui): improve mobile search and consolidate language selector

- On mobile (≤768px), replace the full search bar in the topbar with a
  search icon button; tapping it expands a full-width search overlay
  with a back arrow to collapse (Google Drive-style pattern)
- Escape key also collapses the mobile search overlay
- Hide the redundant inline search icon when the mobile search bar is
  active (submit button already has one)
- Move the language selector from the topbar into the user menu for all
  screen sizes, reducing topbar clutter; it renders as an accordion row
  matching other menu items
- Fix user menu positioning in RTL layouts (Arabic/Persian): anchor to
  left:0 instead of right:0 so the panel opens inward rather than
  off-screen
This commit is contained in:
Kamil Alekberov
2026-05-17 18:33:39 +05:00
committed by Unrepresented
parent 9aef9ea787
commit fe0a8c7f72
5 changed files with 199 additions and 13 deletions
+68 -1
View File
@@ -1,7 +1,6 @@
/* Language Selector - Custom Dropdown */
.language-selector {
position: relative;
margin-right: 15px;
}
.language-selector-toggle {
@@ -108,3 +107,71 @@
.language-option.active .lang-check {
opacity: 1;
}
/* ── Language selector inside user menu ── */
.user-menu .language-selector {
width: 100%;
}
/* Match user-menu-item appearance exactly */
.user-menu .language-selector-toggle {
width: 100%;
background: none !important;
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
outline: none !important;
padding: 12px 20px;
gap: 12px;
color: var(--color-text-dark);
font-size: 14px;
cursor: pointer;
}
.user-menu .language-selector-toggle:hover,
.user-menu .language-selector-toggle:focus {
background: var(--color-bg-hover) !important;
border: none !important;
outline: none !important;
}
.user-menu .language-selector-toggle i.fa-globe {
width: 20px;
text-align: center;
font-size: 15px;
color: var(--color-text-subtle);
}
.user-menu .language-selector-toggle .lang-code {
font-weight: 500;
font-size: 13px;
color: var(--color-text-dark);
}
/* Inline accordion — no floating */
.user-menu .language-selector-dropdown {
position: static !important;
box-shadow: none !important;
border: none !important;
border-top: 1px solid var(--color-border-light);
border-radius: 0 !important;
background: var(--color-bg-muted);
max-height: 0;
overflow: hidden;
opacity: 1 !important;
visibility: visible !important;
transform: none !important;
transition: max-height 0.25s ease;
z-index: auto !important;
}
.user-menu .language-selector.open .language-selector-dropdown {
max-height: 260px;
overflow-y: auto;
}
/* Language options inside user menu — compact rows */
.user-menu .language-option {
padding: 10px 20px 10px 28px;
font-size: 13.5px;
}
+6
View File
@@ -48,6 +48,7 @@
position: absolute;
top: calc(100% + 10px);
right: 0;
left: auto;
width: 300px;
background: var(--color-bg-surface);
border-radius: 16px;
@@ -63,6 +64,11 @@
display: block;
}
[dir="rtl"] .user-menu {
right: auto;
left: 0;
}
@keyframes userMenuIn {
from {
opacity: 0;
+92 -10
View File
@@ -45,17 +45,45 @@
font-size: 20px;
}
/* Mobile responsive styles for top bar */
@media (max-width: 768px) {
.top-bar {
padding: 0 16px;
}
/* Mobile search toggle button — hidden on desktop */
.search-toggle-btn {
display: none;
background: none;
border: none;
padding: 10px;
cursor: pointer;
color: var(--color-text-secondary);
border-radius: 8px;
font-size: 18px;
transition:
background-color 0.2s,
color 0.2s;
flex-shrink: 0;
}
.sidebar-toggle {
display: flex;
align-items: center;
justify-content: center;
}
.search-toggle-btn:hover {
background-color: var(--color-border);
}
/* Back button inside expanded mobile search — hidden everywhere by default */
.search-back-btn {
display: none;
background: none;
border: none;
padding: 10px;
cursor: pointer;
color: var(--color-text-secondary);
border-radius: 8px;
font-size: 18px;
transition:
background-color 0.2s,
color 0.2s;
flex-shrink: 0;
}
.search-back-btn:hover {
background-color: var(--color-border);
color: var(--color-text-heading);
}
.search-container {
@@ -163,3 +191,57 @@
align-items: center;
gap: 12px;
}
/* Mobile responsive styles for top bar */
@media (max-width: 768px) {
.top-bar {
padding: 0 16px;
}
.sidebar-toggle {
display: flex;
align-items: center;
justify-content: center;
}
/* Hide full search bar on mobile by default */
.search-container {
display: none;
}
/* Show icon-only search button; push it to the right before user-controls */
.search-toggle-btn {
display: flex;
align-items: center;
justify-content: center;
margin-left: auto;
}
/* Expanded mobile search: full-width overlay of the top bar */
.top-bar--search-active .search-back-btn {
display: flex;
align-items: center;
justify-content: center;
}
.top-bar--search-active .search-container {
display: flex;
flex-grow: 1;
max-width: none;
margin: 0;
}
.top-bar--search-active .search-icon {
display: none;
}
.top-bar--search-active .search-container input {
padding-left: 16px;
}
.top-bar--search-active .sidebar-toggle,
.top-bar--search-active .search-toggle-btn,
.top-bar--search-active .user-controls {
display: none;
}
}