Files
simple-aircraft-manager-rails/app/views/shared/_airport_field.html.erb
T
rickyandClaude Opus 5.5 86aadfcf6c Add dark mode; align table headers with numeric columns
Dark mode:
- Theme toggle in the header (System → Light → Dark); "System" follows
  the OS setting and its changes. The choice is kept per browser and
  applied before first paint, so there's no light flash.
- Implemented by remapping the palette under :root[data-theme=dark]:
  grays flip, color tints become translucent, dark colored text becomes
  its light counterpart. Page, surface, header and accent colors are
  semantic tokens. Native controls follow via color-scheme.
- Chart text and grid colors follow the theme.
- Public share pages get the toggle too.
- Contrast checked against WCAG 4.5:1 (primary button text and error
  text adjusted for dark).

Tables:
- Shared table style no longer forces header text left, so right-aligned
  numeric headers line up with their columns everywhere.
- Flight log: units in headers, muted dashes for empty cells, GPS marker
  beside the route instead of its own column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:53:11 -05:00

12 lines
937 B
ERB

<%# Airport code input with autocomplete. locals: f, attribute, label, aircraft %>
<div class="relative" data-controller="airport-autocomplete"
data-airport-autocomplete-url-value="<%= airport_search_path(aircraft_id: aircraft.id) %>">
<%= f.label attribute, label, class: "label" %>
<%= f.text_field attribute, class: "input font-mono uppercase placeholder:normal-case placeholder:font-sans", placeholder: local_assigns[:placeholder], maxlength: 10,
data: { airport_autocomplete_target: "input",
action: "input->airport-autocomplete#search keydown->airport-autocomplete#keydown blur->airport-autocomplete#blur" } %>
<ul data-airport-autocomplete-target="list" role="listbox" hidden
class="absolute z-20 mt-1 max-h-72 w-[min(28rem,90vw)] overflow-auto rounded-md bg-surface py-1 shadow-lg ring-1 ring-slate-200"></ul>
<p class="hint min-h-4" data-airport-autocomplete-target="hint"></p>
</div>