From dffa46dfde182d9b3d234368504a9b49ce31ecc2 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 3 Jan 2026 11:02:38 -0600 Subject: [PATCH] Improve UI styling and remove DaisyUI dependencies - Remove default Phoenix branding and create custom layouts - Replace DaisyUI classes with custom Tailwind components throughout - Add authenticated layout with navigation bar for organization pages - Redesign all core components (buttons, forms, tables, alerts) - Make dashboard stat cards clickable to navigate to respective pages - Update alert acknowledge button to only show for equipment down alerts - Add consistent dark mode support across all pages - Implement modern design with zinc color palette and improved spacing --- .../components/core_components.ex | 258 ++++++++++++------ lib/towerops_web/components/layouts.ex | 131 +++++++-- .../components/layouts/root.html.heex | 22 +- .../user_registration_html/new.html.heex | 33 ++- .../user_session_html/confirm.html.heex | 103 +++---- .../user_session_html/new.html.heex | 119 ++++---- .../live/alert_live/index.html.heex | 234 ++++++++-------- .../live/dashboard_live.html.heex | 31 ++- .../live/equipment_live/index.html.heex | 141 +++++----- .../live/org_live/index.html.heex | 57 ++-- lib/towerops_web/live/org_live/new.html.heex | 12 +- .../live/site_live/index.html.heex | 86 +++--- 12 files changed, 700 insertions(+), 527 deletions(-) diff --git a/lib/towerops_web/components/core_components.ex b/lib/towerops_web/components/core_components.ex index c7165a71..532745f9 100644 --- a/lib/towerops_web/components/core_components.ex +++ b/lib/towerops_web/components/core_components.ex @@ -8,12 +8,8 @@ defmodule ToweropsWeb.CoreComponents do with doc strings and declarative assigns. You may customize and style them in any way you want, based on your application growth and needs. - The foundation for styling is Tailwind CSS, a utility-first CSS framework, - augmented with daisyUI, a Tailwind CSS plugin that provides UI components - and themes. Here are useful references: - - * [daisyUI](https://daisyui.com/docs/intro/) - a good place to get - started and see the available components. + The foundation for styling is Tailwind CSS, a utility-first CSS framework. + Here are useful references: * [Tailwind CSS](https://tailwindcss.com) - the foundational framework we build on. You will use it for layout, sizing, flexbox, grid, and @@ -57,24 +53,62 @@ defmodule ToweropsWeb.CoreComponents do id={@id} phx-click={JS.push("lv:clear-flash", value: %{key: @kind}) |> hide("##{@id}")} role="alert" - class="toast toast-top toast-end z-50" + class="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-50" {@rest} > -
- <.icon :if={@kind == :info} name="hero-information-circle" class="size-5 shrink-0" /> - <.icon :if={@kind == :error} name="hero-exclamation-circle" class="size-5 shrink-0" /> -
-

{@title}

-

{msg}

+
+
+
+
+
+ <.icon + :if={@kind == :info} + name="hero-information-circle" + class="h-6 w-6 text-blue-600 dark:text-blue-400" + /> + <.icon + :if={@kind == :error} + name="hero-exclamation-circle" + class="h-6 w-6 text-red-600 dark:text-red-400" + /> +
+
+

+ {@title} +

+

+ {msg} +

+
+
+ +
+
+
-
-
""" @@ -95,11 +129,19 @@ defmodule ToweropsWeb.CoreComponents do slot :inner_block, required: true def button(%{rest: rest} = assigns) do - variants = %{"primary" => "btn-primary", nil => "btn-primary btn-soft"} + variants = %{ + "primary" => + "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500 dark:bg-blue-500 dark:hover:bg-blue-600", + nil => + "bg-white text-zinc-900 ring-1 ring-inset ring-zinc-300 hover:bg-zinc-50 focus:ring-blue-500 dark:bg-zinc-800 dark:text-zinc-100 dark:ring-zinc-700 dark:hover:bg-zinc-700" + } assigns = assign_new(assigns, :class, fn -> - ["btn", Map.fetch!(variants, assigns[:variant])] + [ + "inline-flex items-center gap-2 rounded-lg px-3.5 py-2.5 text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", + Map.fetch!(variants, assigns[:variant]) + ] end) if rest[:href] || rest[:navigate] || rest[:patch] do @@ -204,8 +246,8 @@ defmodule ToweropsWeb.CoreComponents do end) ~H""" -
-