Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions frontend/app/components/SearchFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ interface SortOption {
value: string;
}

const selectClass =
"filter-select px-3 py-2.5 bg-[var(--bg-card)] border border-[var(--border-subtle)] rounded-lg text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent-gold)]/50 cursor-pointer text-sm";

function groupOptions(options: FilterOption[]): { group?: string; opts: FilterOption[] }[] {
const segments: { group?: string; opts: FilterOption[] }[] = [];
for (const opt of options) {
Expand Down Expand Up @@ -94,21 +97,25 @@ export default function SearchFilter({
key={filter.label}
value={filter.value}
onChange={(e) => filter.onChange(e.target.value)}
className="px-3 py-2.5 bg-[var(--bg-card)] border border-[var(--border-subtle)] rounded-lg text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent-gold)]/50 cursor-pointer text-sm"
className={selectClass}
>
{!filter.noEmptyOption && <option value="">{filter.label}</option>}
{!filter.noEmptyOption && (
<option className="filter-option" value="">
{filter.label}
</option>
)}
{groupOptions(filter.options).map((seg, i) =>
seg.group ? (
<optgroup key={`${seg.group}-${i}`} label={seg.group}>
{seg.opts.map((opt) => (
<option key={opt.value} value={opt.value}>
<option className="filter-option" key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</optgroup>
) : (
seg.opts.map((opt) => (
<option key={opt.value} value={opt.value}>
<option className="filter-option" key={opt.value} value={opt.value}>
{opt.label}
</option>
))
Expand All @@ -120,10 +127,10 @@ export default function SearchFilter({
<select
value={sortValue}
onChange={(e) => onSortChange(e.target.value)}
className="px-3 py-2.5 bg-[var(--bg-card)] border border-[var(--border-subtle)] rounded-lg text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent-gold)]/50 cursor-pointer text-sm"
className={selectClass}
>
{sortOptions.map((opt) => (
<option key={opt.value} value={opt.value}>
<option className="filter-option" key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
Expand Down
12 changes: 12 additions & 0 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ body {
font-family: var(--font-kreon), var(--font-geist-sans), Arial, Helvetica, sans-serif;
}

/* Kreon's deep descenders (g, y, p) get cut off by the default line boxes
native selects give their options at small sizes, so the compendium
filter/sort selects carry explicit classes with roomier line-height. */
select.filter-select {
line-height: 1.5;
}
select.filter-select option,
select.filter-select optgroup {
line-height: 1.6;
padding-block: 3px;
}

/* Site-wide atmospheric background: the main-menu art, fixed to the viewport
and kept faint so it reads as a textured ground behind every page. It paints
above the body's base color (var(--bg-primary)) but behind all content, so it
Expand Down
Loading