little refactore
This commit is contained in:
@@ -1,64 +1,151 @@
|
||||
@layer components {
|
||||
/* Global sidebar search — input, result list, preview rows, and search result cards. */
|
||||
.app-search {
|
||||
position: relative;
|
||||
padding: 0 var(--app-spacing);
|
||||
margin-bottom: var(--app-spacing);
|
||||
}
|
||||
/*
|
||||
* Search command-palette dialog.
|
||||
*
|
||||
* Builds on the core dialog base (app-shell.css → dialog, dialog > article)
|
||||
* and the shared tier system (app-dialog.css → app-dialog-lg).
|
||||
* Only search-specific overrides live here.
|
||||
*/
|
||||
|
||||
.app-search-shortcut {
|
||||
position: absolute;
|
||||
right: calc(var(--app-spacing) + 0.5rem);
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border: 1px solid var(--app-border);
|
||||
border-radius: 6px;
|
||||
background: var(--app-card-background-color);
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-xs);
|
||||
line-height: var(--leading-none);
|
||||
padding: 0.2rem 0.4rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
/* ── Dialog positioning: top-aligned instead of centered ─────────────── */
|
||||
|
||||
.app-search-empty-state {
|
||||
margin: var(--app-spacing);
|
||||
padding: 1rem;
|
||||
border: 1px dashed var(--app-border);
|
||||
border-radius: var(--app-border-radius);
|
||||
text-align: center;
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-sm);
|
||||
cursor: text;
|
||||
}
|
||||
dialog[data-app-search-dialog] {
|
||||
align-items: flex-start;
|
||||
padding-top: clamp(2rem, 10vh, 8rem);
|
||||
}
|
||||
|
||||
.app-search-empty-state .bi-search {
|
||||
display: inline-block;
|
||||
font-size: var(--text-xl);
|
||||
margin-bottom: 0.5rem;
|
||||
color: var(--app-color);
|
||||
}
|
||||
/* ── Article: flex column so body scrolls, header/footer stay fixed ──── */
|
||||
|
||||
.app-search-empty-state p {
|
||||
margin: 0 0 0.25rem;
|
||||
}
|
||||
.app-search-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-search-empty-state small {
|
||||
display: block;
|
||||
}
|
||||
/* ── Header: search input row ────────────────────────────────────────── */
|
||||
|
||||
ul.app-search-results {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.app-search-dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
ul.app-search-results > li > a {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.app-search-dialog-header h2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul.app-search-results .badge {
|
||||
.app-search-dialog-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.app-search-dialog-icon {
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-base);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.app-search-dialog-input {
|
||||
flex: 1;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: var(--text-base);
|
||||
color: var(--app-color);
|
||||
outline: none;
|
||||
padding: 0.25rem 0;
|
||||
margin: 0;
|
||||
height: auto;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.app-search-dialog-input:focus {
|
||||
box-shadow: none;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.app-search-dialog-shortcut {
|
||||
border: 1px solid var(--app-border);
|
||||
border-radius: 4px;
|
||||
background: var(--app-card-background-color);
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-xs);
|
||||
line-height: var(--leading-none);
|
||||
padding: 0.15rem 0.35rem;
|
||||
pointer-events: none;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.app-search-dialog-header .close {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ── Body: scrollable area between header and footer ─────────────────── */
|
||||
|
||||
.app-search-dialog-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
/* ── Empty / loading / error states ──────────────────────────────────── */
|
||||
|
||||
.app-search-dialog-empty-state,
|
||||
.app-search-dialog-loading,
|
||||
.app-search-dialog-error {
|
||||
padding: 1.5rem 1rem;
|
||||
text-align: center;
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.app-search-dialog-empty-state p,
|
||||
.app-search-dialog-loading p,
|
||||
.app-search-dialog-error p {
|
||||
margin: 0 0 0.25rem;
|
||||
}
|
||||
|
||||
.app-search-dialog-empty-state small {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ── Results list ────────────────────────────────────────────────────── */
|
||||
|
||||
.app-search-dialog-results {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ── Category group ──────────────────────────────────────────────────── */
|
||||
|
||||
.app-search-dialog-category {
|
||||
list-style: none;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.app-search-dialog-category-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: var(--text-xs);
|
||||
font-weight: var(--font-semibold);
|
||||
color: var(--app-muted-color);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: var(--tracking-wide);
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.app-search-dialog-category-heading .bi {
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.app-search-dialog-category-count {
|
||||
margin-left: auto;
|
||||
font-size: 10px; /* icon-font metric — intentional px */
|
||||
padding: 1px;
|
||||
padding: 1px 4px;
|
||||
min-width: 18px;
|
||||
text-align: center;
|
||||
border-radius: 999px;
|
||||
@@ -67,84 +154,100 @@ ul.app-search-results .badge {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 18px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
ul.app-search-preview {
|
||||
position: relative;
|
||||
font-size: var(--text-xs);
|
||||
padding: 0 0 0 0;
|
||||
margin: 0;
|
||||
opacity: 0.75;
|
||||
/* ── Individual result items ─────────────────────────────────────────── */
|
||||
|
||||
.app-search-dialog-category-items {
|
||||
list-style: none;
|
||||
}
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
/* Hide preview rows (detail results) */
|
||||
.search-details-hidden ul.app-search-preview {
|
||||
display: none;
|
||||
}
|
||||
.app-search-dialog-item {
|
||||
border-radius: var(--app-border-radius);
|
||||
transition: background var(--app-transition);
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ul.app-search-preview li {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.app-search-preview li::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 17px;
|
||||
bottom: 11px;
|
||||
width: 8px;
|
||||
height: 10px;
|
||||
background: transparent;
|
||||
border-left: 1px solid var(--app-border);
|
||||
border-bottom: 1px solid var(--app-border);
|
||||
border-bottom-left-radius: 6px;
|
||||
}
|
||||
|
||||
ul.app-search-preview a {
|
||||
padding-inline: 30px;
|
||||
.app-search-dialog-item a {
|
||||
display: block;
|
||||
color: var(--app-color);
|
||||
text-decoration: none;
|
||||
font-size: var(--text-sm);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
border: none;
|
||||
}
|
||||
border-radius: var(--app-border-radius);
|
||||
}
|
||||
|
||||
ul.app-search-preview a:hover {
|
||||
border: none;
|
||||
}
|
||||
.app-search-dialog-item:hover,
|
||||
.app-search-dialog-item-active {
|
||||
background: color-mix(in srgb, var(--app-contrast) 8%, transparent);
|
||||
}
|
||||
|
||||
input#side-search {
|
||||
--app-form-element-spacing-horizontal: 10px;
|
||||
--app-form-element-spacing-vertical: 6px;
|
||||
height: auto;
|
||||
font-size: var(--text-sm);
|
||||
padding-right: 3rem;
|
||||
margin-bottom: 0;
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
.app-search-dialog-item-active a {
|
||||
color: var(--app-primary);
|
||||
}
|
||||
|
||||
ul.app-search-preview:has(li) {
|
||||
margin-bottom: 1rem!important;
|
||||
}
|
||||
/* ── Category "view all" link ────────────────────────────────────────── */
|
||||
|
||||
.search-result-row {
|
||||
.app-search-dialog-category-view-all {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--app-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.app-search-dialog-category-view-all:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ── Footer ──────────────────────────────────────────────────────────── */
|
||||
|
||||
.app-search-dialog-footer {
|
||||
justify-content: space-between;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--app-muted-color);
|
||||
}
|
||||
|
||||
.app-search-dialog-view-all {
|
||||
color: var(--app-primary);
|
||||
text-decoration: none;
|
||||
font-weight: var(--font-medium);
|
||||
}
|
||||
|
||||
.app-search-dialog-view-all:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ── Mobile ──────────────────────────────────────────────────────────── */
|
||||
|
||||
@media (max-width: 576px) {
|
||||
dialog[data-app-search-dialog] {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Full search results page (Grid.js) ──────────────────────────────── */
|
||||
|
||||
.search-result-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.search-result-title-container {
|
||||
.search-result-title-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.search-result-avatar,
|
||||
.search-result-avatar-placeholder {
|
||||
.search-result-avatar,
|
||||
.search-result-avatar-placeholder {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
@@ -156,23 +259,21 @@ ul.app-search-preview:has(li) {
|
||||
color: var(--app-muted-color);
|
||||
flex-shrink: 0;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.search-result-title {
|
||||
.search-result-title {
|
||||
font-weight: var(--font-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.search-result-desc {
|
||||
.search-result-desc {
|
||||
margin: 0;
|
||||
color: var(--app-muted-color);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
}
|
||||
|
||||
.search-result-type {
|
||||
.search-result-type {
|
||||
color: var(--app-muted-color);
|
||||
font-weight: var(--font-semibold);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user