mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
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>
This commit is contained in:
1 parent
5bf682502b
commit
86aadfcf6c
13 files changed
+216
-25
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="h-full bg-slate-100">
|
||||
<html class="h-full bg-page">
|
||||
<head>
|
||||
<%= render "shared/theme_script" %>
|
||||
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
@@ -16,7 +17,7 @@
|
||||
</head>
|
||||
|
||||
<body class="min-h-full text-slate-800">
|
||||
<header class="bg-slate-900 text-white">
|
||||
<header class="bg-header text-white">
|
||||
<div class="mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3">
|
||||
<%= link_to root_path, class: "flex items-center gap-2 font-semibold tracking-tight" do %>
|
||||
<span class="text-xl">✈</span> Simple Aircraft Manager
|
||||
@@ -29,15 +30,16 @@
|
||||
<summary class="flex cursor-pointer list-none items-center gap-1 hover:text-sky-300 [&::-webkit-details-marker]:hidden">
|
||||
Admin <span aria-hidden="true" class="text-xs">▾</span>
|
||||
</summary>
|
||||
<div class="absolute right-0 z-30 mt-2 w-48 rounded-md bg-white py-1 text-slate-700 shadow-lg ring-1 ring-slate-200">
|
||||
<div class="absolute right-0 z-30 mt-2 w-48 rounded-md bg-surface py-1 text-slate-700 shadow-lg ring-1 ring-slate-200">
|
||||
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ] ].each do |label, path| %>
|
||||
<%= link_to label, path, class: [ "block px-4 py-2 text-sm hover:bg-slate-100", ("font-semibold text-sky-700" if current_page?(path)) ] %>
|
||||
<% end %>
|
||||
</div>
|
||||
</details>
|
||||
<% end %>
|
||||
<%= link_to current_user.display_name, edit_profile_path, class: "text-slate-300 hover:text-sky-300 hidden sm:inline" %>
|
||||
<%= button_to "Sign out", session_path, method: :delete, class: "rounded bg-slate-700 px-2 py-1 hover:bg-slate-600" %>
|
||||
<%= link_to current_user.display_name, edit_profile_path, class: "text-white/70 hover:text-sky-300 hidden sm:inline" %>
|
||||
<%= render "shared/theme_toggle" %>
|
||||
<%= button_to "Sign out", session_path, method: :delete, class: "rounded bg-white/10 px-2 py-1 hover:bg-white/20" %>
|
||||
</nav>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user