Refactor CSS styling

This commit is contained in:
2026-04-29 19:38:41 +02:00
parent 903f21e7f1
commit 762d86b84a
2 changed files with 12 additions and 30 deletions
+8 -10
View File
@@ -3,16 +3,14 @@
{{define "content"}} {{define "content"}}
{{if .Query}} {{if .Query}}
{{if .Results}} {{if .Results}}
<h2 class="muted search-summary">{{len .Results}} match{{if ne (len .Results) 1}}es{{end}} for &ldquo;{{.Query}}&rdquo;</h2> <p class="muted">{{len .Results}} match{{if ne (len .Results) 1}}es{{end}} for &ldquo;{{.Query}}&rdquo;</p>
<div class="search-results"> {{range .Results}}
{{range .Results}} <article class="search-card">
<article class="search-card"> <a href="{{.URL}}">{{.Name}}</a>
<a class="search-card-name" href="{{.URL}}">{{.Name}}</a> <div class="muted">/{{.Path}}</div>
<div class="search-card-path muted">/{{.Path}}</div> {{if .Snippet}}<div>{{.Snippet}}</div>{{end}}
{{if .Snippet}}<div class="search-card-snippet">{{.Snippet}}</div>{{end}} </article>
</article> {{end}}
{{end}}
</div>
{{else}} {{else}}
<p class="empty">No matches for &ldquo;{{.Query}}&rdquo;.</p> <p class="empty">No matches for &ldquo;{{.Query}}&rdquo;.</p>
{{end}} {{end}}
+4 -20
View File
@@ -379,41 +379,25 @@ textarea {
.search-input:focus { .search-input:focus {
border-color: var(--primary-hover); border-color: var(--primary-hover);
} }
.search-summary {
margin-bottom: 1rem;
}
.search-results {
display: flex;
flex-direction: column;
gap: 1rem;
}
.search-card { .search-card {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.25rem; gap: 0.25rem;
padding-bottom: 1rem; padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: 1px dashed var(--secondary); border-bottom: 1px dashed var(--secondary);
word-break: break-word;
} }
.search-card:last-child { .search-card:last-child {
border-bottom: none; border-bottom: none;
} }
.search-card-name { .search-card a {
color: var(--link); color: var(--link);
font-size: 1.1rem; font-size: 1.1rem;
word-break: break-word;
} }
.search-card-name:hover { .search-card a:hover {
color: var(--link-hover); color: var(--link-hover);
} }
.search-card-path {
word-break: break-all;
}
.search-card-snippet {
font-size: 0.9rem;
line-height: 1.5;
color: var(--text-muted);
margin-top: 0.25rem;
}
/* === Muted text === */ /* === Muted text === */
.muted { .muted {