From ebcd54be5b45e51b102c7570f5d625fee53e8f17 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 23 Jun 2026 10:44:20 -0500 Subject: [PATCH] refactor: remove daisyUI, use straight Tailwind v4 with custom color palette - Remove daisyUI plugins and theme from app.css - Define 5 custom color palettes: sweet-salmon, desert-sand, wheat, cool-steel, cerulean - Add @utility card, badge, btn classes to replace daisyUI components - Replace all daisyUI classes across 16+ template files - Update tests for new class return values - Set light mode as default theme --- assets/css/app.css | 280 ++++++++++-------- lib/towerops_web/components/breadcrumbs.ex | 4 +- .../user_settings_html/edit.html.heex | 4 +- .../live/activity_feed_live.html.heex | 6 +- lib/towerops_web/live/changelog_live.ex | 15 +- lib/towerops_web/live/config_timeline_live.ex | 82 +++-- .../live/coverage_live/form.html.heex | 5 +- .../live/coverage_live/index.html.heex | 20 +- .../live/coverage_live/map.html.heex | 15 +- .../live/coverage_live/show.html.heex | 7 +- .../live/device_live/show.html.heex | 2 +- .../live/insights_live/index.html.heex | 12 +- .../live/org/settings_live.html.heex | 10 +- .../live/site_live/index.html.heex | 13 +- .../live/site_live/show.html.heex | 28 +- lib/towerops_web/live/trace_live/index.ex | 38 ++- .../live/trace_live/index.html.heex | 110 ++++--- .../config_timeline_live_helpers_test.exs | 35 ++- 18 files changed, 410 insertions(+), 276 deletions(-) diff --git a/assets/css/app.css b/assets/css/app.css index 8b7e64c7..72ec14e9 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -6,92 +6,78 @@ @source "../js"; @source "../../lib/towerops_web"; -/* A Tailwind plugin that makes "hero-#{ICON}" classes available. - The heroicons installation itself is managed by your mix.exs */ +/* ── Custom color palette ── */ +@theme { + --color-sweet-salmon-50: #ffe7e6; + --color-sweet-salmon-100: #fed0cd; + --color-sweet-salmon-200: #fea19a; + --color-sweet-salmon-300: #fd7268; + --color-sweet-salmon-400: #fd4235; + --color-sweet-salmon-500: #fc1303; + --color-sweet-salmon-600: #ca0f02; + --color-sweet-salmon-700: #970c02; + --color-sweet-salmon-800: #650801; + --color-sweet-salmon-900: #320401; + --color-sweet-salmon-950: #230300; + + --color-desert-sand-50: #faf0eb; + --color-desert-sand-100: #f5e2d6; + --color-desert-sand-200: #ebc5ad; + --color-desert-sand-300: #e0a885; + --color-desert-sand-400: #d68b5c; + --color-desert-sand-500: #cc6e33; + --color-desert-sand-600: #a35829; + --color-desert-sand-700: #7a421f; + --color-desert-sand-800: #522c14; + --color-desert-sand-900: #29160a; + --color-desert-sand-950: #1d0f07; + + --color-wheat-50: #faf4eb; + --color-wheat-100: #f5e9d6; + --color-wheat-200: #ebd3ad; + --color-wheat-300: #e0bd85; + --color-wheat-400: #d6a75c; + --color-wheat-500: #cc9133; + --color-wheat-600: #a37429; + --color-wheat-700: #7a571f; + --color-wheat-800: #523a14; + --color-wheat-900: #291d0a; + --color-wheat-950: #1d1407; + + --color-cool-steel-50: #f0f3f4; + --color-cool-steel-100: #e1e7ea; + --color-cool-steel-200: #c4cfd4; + --color-cool-steel-300: #a6b7bf; + --color-cool-steel-400: #89a0a9; + --color-cool-steel-500: #6b8894; + --color-cool-steel-600: #566d76; + --color-cool-steel-700: #405159; + --color-cool-steel-800: #2b363b; + --color-cool-steel-900: #151b1e; + --color-cool-steel-950: #0f1315; + + --color-cerulean-50: #edf4f8; + --color-cerulean-100: #dbe9f0; + --color-cerulean-200: #b6d3e2; + --color-cerulean-300: #92bcd3; + --color-cerulean-400: #6da6c5; + --color-cerulean-500: #4990b6; + --color-cerulean-600: #3a7392; + --color-cerulean-700: #2c566d; + --color-cerulean-800: #1d3a49; + --color-cerulean-900: #0f1d24; + --color-cerulean-950: #0a141a; + + /* Design tokens (replaces daisyUI semantic variables) */ + --radius-selector: 0.25rem; + --radius-field: 0.25rem; + --radius-box: 0.5rem; +} + +/* Heroicons plugin */ @plugin "../vendor/heroicons"; -/* daisyUI Tailwind Plugin. You can update this file by fetching the latest version with: - curl -sLO https://github.com/saadeghi/daisyui/releases/latest/download/daisyui.js - Make sure to look at the daisyUI changelog: https://daisyui.com/docs/changelog/ */ -@plugin "../vendor/daisyui" { - themes: false; -} - -/* daisyUI theme plugin. You can update this file by fetching the latest version with: - curl -sLO https://github.com/saadeghi/daisyui/releases/latest/download/daisyui-theme.js - We ship with two themes, a light one inspired on Phoenix colors and a dark one inspired - on Elixir colors. Build your own at: https://daisyui.com/theme-generator/ */ -@plugin "../vendor/daisyui-theme" { - name: "dark"; - default: false; - prefersdark: true; - color-scheme: "dark"; - --color-base-100: oklch(30.33% 0.016 252.42); - --color-base-200: oklch(25.26% 0.014 253.1); - --color-base-300: oklch(20.15% 0.012 254.09); - --color-base-content: oklch(97.807% 0.029 256.847); - --color-primary: oklch(58% 0.233 277.117); - --color-primary-content: oklch(96% 0.018 272.314); - --color-secondary: oklch(58% 0.233 277.117); - --color-secondary-content: oklch(96% 0.018 272.314); - --color-accent: oklch(60% 0.25 292.717); - --color-accent-content: oklch(96% 0.016 293.756); - --color-neutral: oklch(37% 0.044 257.287); - --color-neutral-content: oklch(98% 0.003 247.858); - --color-info: oklch(58% 0.158 241.966); - --color-info-content: oklch(97% 0.013 236.62); - --color-success: oklch(60% 0.118 184.704); - --color-success-content: oklch(98% 0.014 180.72); - --color-warning: oklch(66% 0.179 58.318); - --color-warning-content: oklch(98% 0.022 95.277); - --color-error: oklch(58% 0.253 17.585); - --color-error-content: oklch(96% 0.015 12.422); - --radius-selector: 0.25rem; - --radius-field: 0.25rem; - --radius-box: 0.5rem; - --size-selector: 0.21875rem; - --size-field: 0.21875rem; - --border: 1.5px; - --depth: 1; - --noise: 0; -} - -@plugin "../vendor/daisyui-theme" { - name: "light"; - default: true; - prefersdark: false; - color-scheme: "light"; - --color-base-100: oklch(98% 0 0); - --color-base-200: oklch(96% 0.001 286.375); - --color-base-300: oklch(92% 0.004 286.32); - --color-base-content: oklch(21% 0.006 285.885); - --color-primary: oklch(70% 0.213 47.604); - --color-primary-content: oklch(98% 0.016 73.684); - --color-secondary: oklch(55% 0.027 264.364); - --color-secondary-content: oklch(98% 0.002 247.839); - --color-accent: oklch(0% 0 0); - --color-accent-content: oklch(100% 0 0); - --color-neutral: oklch(44% 0.017 285.786); - --color-neutral-content: oklch(98% 0 0); - --color-info: oklch(62% 0.214 259.815); - --color-info-content: oklch(97% 0.014 254.604); - --color-success: oklch(70% 0.14 182.503); - --color-success-content: oklch(98% 0.014 180.72); - --color-warning: oklch(66% 0.179 58.318); - --color-warning-content: oklch(98% 0.022 95.277); - --color-error: oklch(58% 0.253 17.585); - --color-error-content: oklch(96% 0.015 12.422); - --radius-selector: 0.25rem; - --radius-field: 0.25rem; - --radius-box: 0.5rem; - --size-selector: 0.21875rem; - --size-field: 0.21875rem; - --border: 1.5px; - --depth: 1; - --noise: 0; -} - -/* Add variants based on LiveView classes */ +/* ── Custom variants ── */ @custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &); @custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &); @custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &); @@ -99,6 +85,56 @@ /* Use the data attribute for dark mode */ @custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *)); +/* ── Reusable utility classes (replaces daisyUI component classes) ── */ + +/* Card — replaces daisyUI `card card-body bg-base-100 border-base-200` */ +@utility card { + border-radius: var(--radius-box); + border: 1px solid var(--color-cool-steel-200); + background: var(--color-cool-steel-50); + padding: 1.5rem; +} +[data-theme="dark"] .card { + border-color: var(--color-cool-steel-700); + background: var(--color-cool-steel-900); +} + +/* Badge — replaces daisyUI `badge` */ +@utility badge { + display: inline-flex; + align-items: center; + border-radius: 9999px; + padding-inline: 0.625rem; + padding-block: 0.125rem; + font-size: 0.75rem; + font-weight: 500; + line-height: 1.25rem; +} + +/* Button base — replaces daisyUI `btn` (for standalone usage outside core_components) */ +@utility btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + border-radius: var(--radius-field); + padding-inline: 1rem; + padding-block: 0.5rem; + font-size: 0.875rem; + font-weight: 500; + line-height: 1.25rem; + cursor: pointer; + border: 1px solid transparent; + background: var(--color-cool-steel-200); + color: var(--color-cool-steel-900); + transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; +} +[data-theme="dark"] .btn { + background: var(--color-cool-steel-700); + color: var(--color-cool-steel-50); +} + +/* ── Base element styles (replaces daisyUI resets) ── */ + /* Make LiveView wrapper divs transparent for layout */ [data-phx-session], [data-phx-teleported-src] { display: contents } @@ -107,10 +143,11 @@ /* Sidebar layout */ #app-sidebar { - @apply w-56 transition-all duration-200; + width: 14rem; + transition: width 0.2s ease; } html.sidebar-collapsed #app-sidebar { - @apply w-16; + width: 4rem; } html.sidebar-collapsed [data-sidebar-text] { display: none; @@ -144,10 +181,10 @@ html.sidebar-collapsed [data-sidebar-tooltip]:hover::after { pointer-events: none; } #main-wrapper { - @apply transition-all duration-200; + transition: width 0.2s ease; } -/* This file is for your main application CSS */ +/* ── Animations ── */ /* Page transitions */ @keyframes fadeIn { @@ -157,7 +194,7 @@ html.sidebar-collapsed [data-sidebar-tooltip]:hover::after { .page-fade-in { animation: fadeIn 0.15s ease-out; } /* Smooth transitions on interactive elements */ -.card, .btn, .badge, .alert { +.card, .btn, .badge { transition: box-shadow 0.15s ease, transform 0.15s ease; } @@ -179,40 +216,6 @@ html.sidebar-collapsed [data-sidebar-tooltip]:hover::after { } .status-pulse { animation: statusPulse 2s ease-in-out infinite; } -/* Scrollbar styling for webkit */ -::-webkit-scrollbar { width: 6px; height: 6px; } -::-webkit-scrollbar-track { background: transparent; } -::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; } -::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); } -[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); } -[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); } - -/* Table row hover highlight */ -tbody tr:hover td { background-color: rgba(59, 130, 246, 0.04); } -[data-theme="dark"] tbody tr:hover td { background-color: rgba(59, 130, 246, 0.08); } - -/* Focus ring styling */ -:focus-visible { - outline: 2px solid oklch(58% 0.233 277.117); - outline-offset: 2px; -} - -/* Global smooth transitions for interactive elements */ -a, button, input, select, textarea { - transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; -} - -/* Dark mode body transition */ -body, .bg-gray-50, .bg-white, .dark\:bg-gray-950, .dark\:bg-gray-900 { - transition: background-color 0.2s ease; -} - -/* Password strength indicator (JS-driven via classes) */ -.password-strength-bar.strength-weak { background-color: #ef4444; } -.password-strength-bar.strength-fair { background-color: #f59e0b; } -.password-strength-bar.strength-good { background-color: #22c55e; } -.password-strength-bar.strength-strong { background-color: #16a34a; } - /* Skeleton shimmer effect */ @keyframes shimmer { 0% { background-position: -200% 0; } @@ -223,3 +226,34 @@ body, .bg-gray-50, .bg-white, .dark\:bg-gray-950, .dark\:bg-gray-900 { background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; } + +/* ── Global element styles ── */ + +/* Scrollbar styling for webkit */ +::-webkit-scrollbar { width: 6px; height: 6px; } +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; } +::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); } +[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); } +[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); } + +/* Table row hover highlight */ +tbody tr:hover td { background-color: rgba(73, 144, 182, 0.06); } +[data-theme="dark"] tbody tr:hover td { background-color: rgba(73, 144, 182, 0.12); } + +/* Focus ring styling */ +:focus-visible { + outline: 2px solid var(--color-cerulean-500); + outline-offset: 2px; +} + +/* Global smooth transitions for interactive elements */ +a, button, input, select, textarea { + transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; +} + +/* Password strength indicator (JS-driven via classes) */ +.password-strength-bar.strength-weak { background-color: var(--color-sweet-salmon-500); } +.password-strength-bar.strength-fair { background-color: var(--color-wheat-500); } +.password-strength-bar.strength-good { background-color: #22c55e; } +.password-strength-bar.strength-strong { background-color: #16a34a; } diff --git a/lib/towerops_web/components/breadcrumbs.ex b/lib/towerops_web/components/breadcrumbs.ex index cb24c454..4d765740 100644 --- a/lib/towerops_web/components/breadcrumbs.ex +++ b/lib/towerops_web/components/breadcrumbs.ex @@ -1,6 +1,6 @@ defmodule ToweropsWeb.Components.Breadcrumbs do @moduledoc """ - Reusable breadcrumb navigation component using DaisyUI. + Reusable breadcrumb navigation component. """ use Phoenix.Component @@ -25,7 +25,7 @@ defmodule ToweropsWeb.Components.Breadcrumbs do def breadcrumb(assigns) do ~H""" -