Add dark mode with toggle and localStorage persistence
Uses Tailwind v4 class-based dark mode with a Stimulus controller for toggling. Respects prefers-color-scheme as default, prevents FOUC with an inline script, and persists the user's choice in localStorage. All views updated with dark: variants for backgrounds, text, borders, badges, buttons, and form inputs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,11 +22,11 @@ module ApplicationHelper
|
||||
|
||||
def border_class_for(type)
|
||||
case type.to_s
|
||||
when "notice" then "border-green-200"
|
||||
when "alert", "error" then "border-red-200"
|
||||
when "warning" then "border-yellow-200"
|
||||
when "info" then "border-blue-200"
|
||||
else "border-gray-200"
|
||||
when "notice" then "border-green-200 dark:border-green-700"
|
||||
when "alert", "error" then "border-red-200 dark:border-red-700"
|
||||
when "warning" then "border-yellow-200 dark:border-yellow-700"
|
||||
when "info" then "border-blue-200 dark:border-blue-700"
|
||||
else "border-gray-200 dark:border-gray-700"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user