replace DaisyUI components with admin CSS, remove DaisyUI plugin (Phase 6)
Add admin/components.css with custom admin-* component classes replacing all DaisyUI component usage across admin LiveViews, auth pages, layout, and core_components. Delete daisyui.js vendor file (246KB). Theme plugin stays for color variables until Phase 7. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
610
assets/css/admin/components.css
Normal file
610
assets/css/admin/components.css
Normal file
@@ -0,0 +1,610 @@
|
||||
/* Admin component styles — replaces DaisyUI components.
|
||||
Uses DaisyUI theme variables (--color-*) which stay until Phase 7. */
|
||||
|
||||
/* ── Layout ── */
|
||||
|
||||
.admin-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 0 1fr;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.admin-layout-toggle {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.admin-layout-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
grid-column: 2;
|
||||
}
|
||||
|
||||
.admin-sidebar-wrapper {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
z-index: 40;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* When checkbox is checked, show sidebar overlay on mobile */
|
||||
.admin-layout-toggle:checked ~ .admin-sidebar-wrapper {
|
||||
display: block;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 40;
|
||||
}
|
||||
|
||||
.admin-sidebar-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.admin-sidebar {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 16rem;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: var(--color-base-200);
|
||||
}
|
||||
|
||||
@media (min-width: 64em) {
|
||||
.admin-layout {
|
||||
grid-template-columns: 16rem 1fr;
|
||||
}
|
||||
|
||||
.admin-sidebar-wrapper {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.admin-sidebar-overlay {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.admin-topbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Top bar (mobile only) ── */
|
||||
|
||||
.admin-topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
background-color: var(--color-base-100);
|
||||
border-bottom: 1px solid var(--color-base-200);
|
||||
}
|
||||
|
||||
.admin-topbar-title {
|
||||
flex: 1;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ── Sidebar nav ── */
|
||||
|
||||
.admin-nav {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
|
||||
& li a,
|
||||
& li button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
font-size: 0.875rem;
|
||||
transition: background-color 0.1s;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
border: none;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--color-base-300);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--color-base-300);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Buttons ── */
|
||||
|
||||
.admin-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.25rem;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
transition: background-color 0.1s, opacity 0.1s;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-primary-content);
|
||||
|
||||
&:hover { opacity: 0.85; }
|
||||
&:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
}
|
||||
|
||||
.admin-btn-primary {
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-primary-content);
|
||||
}
|
||||
|
||||
.admin-btn-soft {
|
||||
background-color: color-mix(in oklch, var(--color-primary) 12%, transparent);
|
||||
color: var(--color-primary);
|
||||
&:hover { background-color: color-mix(in oklch, var(--color-primary) 20%, transparent); opacity: 1; }
|
||||
}
|
||||
|
||||
.admin-btn-ghost {
|
||||
background: none;
|
||||
color: inherit;
|
||||
&:hover { background-color: var(--color-base-200); opacity: 1; }
|
||||
}
|
||||
|
||||
.admin-btn-outline {
|
||||
background: none;
|
||||
color: inherit;
|
||||
border-color: var(--color-base-300);
|
||||
&:hover { background-color: var(--color-base-200); opacity: 1; }
|
||||
}
|
||||
|
||||
.admin-btn-sm {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.admin-btn-icon {
|
||||
padding: 0.5rem;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.admin-btn-icon-round {
|
||||
padding: 0.25rem;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
/* ── Cards ── */
|
||||
|
||||
.admin-card {
|
||||
background-color: var(--color-base-100);
|
||||
border: 1px solid var(--color-base-200);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.admin-card-body {
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.admin-card-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.admin-card-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
justify-content: flex-end;
|
||||
padding-top: 0.75rem;
|
||||
border-top: 1px solid var(--color-base-200);
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
/* ── Tables ── */
|
||||
|
||||
.admin-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.875rem;
|
||||
|
||||
& th {
|
||||
text-align: left;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: color-mix(in oklch, var(--color-base-content) 60%, transparent);
|
||||
border-bottom: 1px solid var(--color-base-200);
|
||||
}
|
||||
|
||||
& td {
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-bottom: 1px solid color-mix(in oklch, var(--color-base-200) 50%, transparent);
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
& tbody tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-table-zebra tbody tr:nth-child(even) {
|
||||
background-color: color-mix(in oklch, var(--color-base-200) 30%, transparent);
|
||||
}
|
||||
|
||||
/* ── Forms ── */
|
||||
|
||||
.admin-fieldset {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.admin-label {
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.admin-input,
|
||||
.admin-select,
|
||||
.admin-textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--color-base-content);
|
||||
background-color: var(--color-base-100);
|
||||
border: 1px solid var(--color-base-300);
|
||||
border-radius: 0.375rem;
|
||||
transition: border-color 0.15s;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 0 0 1px color-mix(in oklch, var(--color-primary) 20%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
.admin-select {
|
||||
appearance: auto;
|
||||
}
|
||||
|
||||
.admin-input-error {
|
||||
border-color: var(--color-error);
|
||||
|
||||
&:focus {
|
||||
border-color: var(--color-error);
|
||||
box-shadow: 0 0 0 1px color-mix(in oklch, var(--color-error) 20%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
.admin-checkbox {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
accent-color: var(--color-primary);
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.admin-checkbox-sm {
|
||||
width: 0.875rem;
|
||||
height: 0.875rem;
|
||||
}
|
||||
|
||||
.admin-select-sm,
|
||||
.admin-input-sm {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* ── Toggle ── */
|
||||
|
||||
.admin-toggle {
|
||||
appearance: none;
|
||||
width: 2.5rem;
|
||||
height: 1.25rem;
|
||||
background-color: var(--color-base-300);
|
||||
border-radius: 9999px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
vertical-align: middle;
|
||||
flex-shrink: 0;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0.125rem;
|
||||
left: 0.125rem;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
background: white;
|
||||
border-radius: 9999px;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
&:checked {
|
||||
background-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&:checked::after {
|
||||
transform: translateX(1.25rem);
|
||||
}
|
||||
}
|
||||
|
||||
.admin-toggle-sm {
|
||||
width: 2rem;
|
||||
height: 1rem;
|
||||
|
||||
&::after {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
}
|
||||
|
||||
&:checked::after {
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Feedback ── */
|
||||
|
||||
.admin-toast {
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.admin-alert {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.admin-alert-info {
|
||||
background-color: color-mix(in oklch, var(--color-info) 10%, transparent);
|
||||
color: var(--color-info);
|
||||
border: 1px solid color-mix(in oklch, var(--color-info) 25%, transparent);
|
||||
}
|
||||
|
||||
.admin-alert-error {
|
||||
background-color: color-mix(in oklch, var(--color-error) 10%, transparent);
|
||||
color: var(--color-error);
|
||||
border: 1px solid color-mix(in oklch, var(--color-error) 25%, transparent);
|
||||
}
|
||||
|
||||
/* ── Modal ── */
|
||||
|
||||
.admin-modal {
|
||||
border: none;
|
||||
border-radius: 0.75rem;
|
||||
padding: 0;
|
||||
max-width: 32rem;
|
||||
width: calc(100% - 2rem);
|
||||
background-color: var(--color-base-100);
|
||||
color: var(--color-base-content);
|
||||
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
||||
|
||||
&::backdrop {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.admin-modal-box {
|
||||
padding: 1.5rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.admin-modal-close {
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
|
||||
.admin-modal-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
/* ── Badge ── */
|
||||
|
||||
.admin-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.125rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
border-radius: 9999px;
|
||||
background-color: var(--color-base-200);
|
||||
color: color-mix(in oklch, var(--color-base-content) 70%, transparent);
|
||||
}
|
||||
|
||||
.admin-badge-sm {
|
||||
padding: 0 0.375rem;
|
||||
font-size: 0.625rem;
|
||||
}
|
||||
|
||||
/* ── Dropdown ── */
|
||||
|
||||
.admin-dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
|
||||
& .admin-dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
margin-top: 0.25rem;
|
||||
min-width: 12rem;
|
||||
background-color: var(--color-base-100);
|
||||
border: 1px solid var(--color-base-200);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
z-index: 50;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
&:focus-within .admin-dropdown-content,
|
||||
&[open] .admin-dropdown-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Spinner ── */
|
||||
|
||||
@keyframes admin-spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.admin-spinner {
|
||||
display: inline-block;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
border: 2px solid var(--color-base-300);
|
||||
border-top-color: var(--color-primary);
|
||||
border-radius: 9999px;
|
||||
animation: admin-spin 0.6s linear infinite;
|
||||
}
|
||||
|
||||
/* ── Divider ── */
|
||||
|
||||
.admin-divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
color: color-mix(in oklch, var(--color-base-content) 40%, transparent);
|
||||
font-size: 0.75rem;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: "";
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background-color: var(--color-base-300);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── List ── */
|
||||
|
||||
.admin-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.admin-list-row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
padding: 0.75rem 0;
|
||||
border-bottom: 1px solid var(--color-base-200);
|
||||
|
||||
&:last-child { border-bottom: none; }
|
||||
}
|
||||
|
||||
.admin-list-grow {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* ── Form error text ── */
|
||||
|
||||
.admin-error {
|
||||
color: var(--color-error);
|
||||
}
|
||||
|
||||
/* ── Link ── */
|
||||
|
||||
.admin-link {
|
||||
color: var(--color-primary);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.125em;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Range ── */
|
||||
|
||||
.admin-range {
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: 0.375rem;
|
||||
background-color: var(--color-base-300);
|
||||
border-radius: 9999px;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
|
||||
&::-webkit-slider-thumb {
|
||||
appearance: none;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
background: var(--color-primary);
|
||||
border-radius: 9999px;
|
||||
border: 2px solid var(--color-base-100);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
&::-moz-range-thumb {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
background: var(--color-primary);
|
||||
border-radius: 9999px;
|
||||
border: 2px solid var(--color-base-100);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Alert outline ── */
|
||||
|
||||
.admin-alert-outline {
|
||||
background: none;
|
||||
color: color-mix(in oklch, var(--color-base-content) 70%, transparent);
|
||||
border: 1px solid var(--color-base-300);
|
||||
}
|
||||
|
||||
/* ── Swap (visibility toggle) ── */
|
||||
|
||||
.admin-swap {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
|
||||
& .admin-swap-on,
|
||||
& .admin-swap-off {
|
||||
display: none;
|
||||
}
|
||||
|
||||
& .admin-swap-off { display: inline-flex; }
|
||||
|
||||
&.active .admin-swap-on { display: inline-flex; }
|
||||
&.active .admin-swap-off { display: none; }
|
||||
}
|
||||
@@ -10,13 +10,6 @@
|
||||
The heroicons installation itself is managed by your mix.exs */
|
||||
@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
|
||||
@@ -111,7 +104,8 @@
|
||||
/* Theme CSS - Layer 3: Semantic aliases */
|
||||
@import "./theme-semantic.css";
|
||||
|
||||
/* This file is for your main application CSS */
|
||||
/* Admin component styles (replaces DaisyUI components) */
|
||||
@import "./admin/components.css";
|
||||
|
||||
/* Cart drawer open state styles */
|
||||
.cart-drawer.open {
|
||||
|
||||
1031
assets/vendor/daisyui.js
vendored
1031
assets/vendor/daisyui.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user