Migrate UI styling to Tailwind components

This commit is contained in:
2026-08-05 13:04:55 +02:00
parent e60522495a
commit c1c63043c8
4 changed files with 111 additions and 856 deletions
+109 -3
View File
@@ -5,7 +5,9 @@
--font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
--color-catalog-surface: #f4f6f8;
--color-catalog-panel: #22272e;
--color-catalog-panel-soft: #2d333b;
--color-catalog-accent: #7ee34d;
--color-catalog-accent-text: #10220b;
--color-catalog-danger: #e02424;
--color-catalog-focus: #2f6fed;
}
@@ -34,6 +36,110 @@
}
}
/* Compatibility component layer. Existing selectors stay stable while the
visual system is migrated to Tailwind utilities incrementally. */
@import "./tailwind-components.css";
@layer components {
.catalog-screen { @apply grid min-h-screen grid-cols-[172px_292px_minmax(720px,1fr)] bg-catalog-surface; }
.control-panel { @apply flex min-h-screen flex-col gap-1.5 overflow-y-auto bg-catalog-panel p-1.5 text-[11px]; }
.app-status { @apply order-[98] mt-auto rounded border border-slate-600 bg-catalog-panel-soft p-1 text-[10px] leading-tight text-slate-100; }
.safe-mode, #modePill { @apply inline-block rounded bg-slate-100 px-1 py-0.5 text-[10px] font-semibold text-slate-800; }
#databaseStatus.database-error { @apply bg-red-100 text-red-700; }
.record-id { @apply flex h-10 items-center justify-center rounded border border-lime-700 bg-catalog-accent text-[26px] font-bold leading-none text-catalog-accent-text; }
.arrow-row { @apply grid grid-cols-2 gap-1; }
.arrow-button, .action-button, .input-like { @apply w-full rounded border border-slate-300 bg-slate-50 text-center text-slate-900 shadow-sm transition; }
.arrow-button, .action-button { @apply min-h-7 px-1 text-[11px]; }
.arrow-button { @apply relative text-transparent; }
.arrow-button::before { @apply absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-xl leading-none text-slate-900; content: ""; }
.arrow-button-prev::before { content: ""; }
.arrow-button-next::before { content: ""; }
.parser-actions { @apply grid gap-1; }
.parser-actions .action-button { @apply min-h-7; }
.action-button.primary { @apply min-h-8 font-semibold; }
.arrow-button:hover:not(:disabled), .action-button:hover:not(:disabled) { @apply border-slate-500 bg-white; }
.arrow-button:disabled, .action-button:disabled { @apply cursor-not-allowed opacity-50; }
.input-like { @apply h-7 px-1 text-[11px]; }
#scanInput { @apply bg-slate-200 placeholder:text-slate-500; }
.input-like:focus { @apply border-catalog-focus outline-none ring-2 ring-catalog-focus/25; }
.picture-slot { @apply aspect-square w-full overflow-hidden rounded border border-dashed border-slate-500 bg-catalog-panel-soft p-1 text-center text-[11px] text-slate-200; }
.picture-slot img { @apply h-full w-full object-contain; }
.mapping-box { @apply rounded border border-slate-500 bg-catalog-panel-soft; }
.mapping-details summary { @apply grid cursor-pointer grid-cols-[minmax(0,1fr)_22px] items-center px-1 py-1 list-none; }
.mapping-details summary::-webkit-details-marker { display: none; }
.mapping-toggle::before { content: ""; @apply inline-block text-center text-lg leading-none text-slate-100; }
.mapping-details[open] .mapping-toggle::before { content: "⌄"; }
.mapping-state { @apply block truncate rounded px-1 py-0.5 text-[10px] font-normal; }
.mapping-state.is-ready { @apply bg-slate-100 text-slate-800; }
.mapping-state.is-missing { @apply bg-red-100 text-red-700; }
.mapping-list { @apply grid gap-0.5 px-1 pb-1; }
.mapping-source-row { @apply grid grid-cols-[minmax(0,1fr)_auto] items-center gap-1 rounded bg-slate-100 px-1 py-0.5 text-[10px] text-slate-800; }
.mapping-source-row.is-disabled { @apply opacity-50; }
.mapping-source-name { @apply truncate; }
.mapping-source-status { @apply rounded px-1 text-[9px] font-semibold; }
.mapping-source-status.is-ok { @apply bg-emerald-100 text-emerald-700; }
.mapping-source-status.is-bad { @apply bg-red-100 text-red-700; }
.mapping-source-status.is-muted { @apply bg-slate-200 text-slate-600; }
.product-panel { @apply bg-slate-300 pt-[22px]; }
.field-grid { @apply grid grid-cols-[132px_minmax(0,168px)] content-start; }
.field-label, .field-value { @apply min-h-[22px] border-b border-slate-300 px-1 py-0.5 text-[11px] leading-tight; }
.field-label { @apply bg-slate-200 text-slate-800; }
.field-value { @apply bg-teal-50 text-right text-slate-900; }
.field-value[data-field="manufacturer_name"] { @apply font-medium; }
.data-panel { @apply min-w-0 overflow-hidden bg-catalog-surface; }
.table-wrap { @apply h-full overflow-auto; }
.variant-table { @apply w-full border-collapse text-[11px]; }
.variant-table th, .variant-table td { @apply h-[22px] whitespace-nowrap border-b border-r border-slate-300 px-1 py-0.5 text-center; }
.variant-table th { @apply sticky top-0 z-10 bg-slate-200 font-medium text-slate-800; }
.variant-table td { @apply bg-slate-50 text-slate-800; }
.variant-table tr:nth-child(even) td { @apply bg-slate-100; }
.variant-table tr:hover td { @apply bg-slate-200; }
.empty-row { @apply py-4 text-slate-500; }
.variant-table .problem-ean { @apply bg-red-600 font-semibold text-white; }
.modal-backdrop { @apply fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4; }
.modal-backdrop[hidden] { display: none; }
.suggested-dialog, .source-dialog, .settings-dialog { @apply max-h-[90vh] w-full overflow-hidden rounded-lg border border-slate-300 bg-slate-50 shadow-2xl; }
.suggested-dialog { @apply max-w-2xl; }
.source-dialog { @apply max-w-3xl; }
.settings-dialog { @apply max-w-md; }
.suggested-header { @apply flex items-center justify-between border-b border-slate-300 bg-slate-200 px-3 py-2; }
.suggested-header h2 { @apply m-0 text-sm font-semibold text-slate-800; }
.modal-close, .settings-test-button { @apply rounded border border-slate-300 bg-white px-2 py-1 text-[11px] text-slate-800 shadow-sm hover:bg-slate-100; }
.suggested-list, .source-list, .settings-content { @apply max-h-[calc(90vh-48px)] overflow-y-auto p-2; }
.settings-content { @apply grid gap-2; }
.settings-group { @apply m-0 rounded border border-slate-300 p-2; }
.settings-group legend { @apply px-1 text-xs font-semibold text-slate-700; }
.settings-option { @apply flex items-center gap-1 py-0.5 text-[11px] text-slate-700; }
.settings-option input { @apply accent-catalog-focus; }
.settings-option input:disabled + span { @apply text-slate-400; }
.local-db-fields { @apply grid gap-1; }
.local-db-fields[hidden] { display: none; }
.settings-field { @apply grid grid-cols-[72px_minmax(0,1fr)] items-center gap-2 text-[11px] text-slate-700; }
.settings-field input { @apply min-w-0 rounded border border-slate-300 bg-white px-1 py-1 text-[11px]; }
.settings-note, .settings-permissions { @apply m-0 text-[10px] leading-tight text-slate-500; }
.settings-permissions { @apply grid gap-0.5; }
.connection-ok { @apply text-emerald-700; }
.connection-error { @apply text-red-700; }
.suggested-row { @apply grid grid-cols-[40px_minmax(0,1fr)_auto] items-center gap-2 border-b border-slate-200 px-1 py-1 text-[11px]; }
.suggested-row:nth-child(even) { @apply bg-slate-100; }
.suggested-row img { @apply h-9 w-9 object-contain; }
.suggested-id, .suggested-active { @apply text-slate-500; }
.suggested-name, .suggested-reference { @apply min-w-0 truncate; }
.suggested-pick, .source-row-action, .source-picture-action { @apply rounded border border-slate-300 bg-white px-1.5 py-0.5 text-[10px] hover:bg-slate-100; }
.source-section { @apply mb-2 overflow-hidden rounded border border-slate-300; }
.source-section-header, .source-row { @apply flex items-center justify-between gap-2 border-b border-slate-200 px-2 py-1 text-[11px]; }
.source-section-header { @apply bg-slate-200 font-semibold; }
.source-section-actions { @apply flex items-center gap-1; }
.source-row { @apply bg-white hover:bg-slate-100; }
.source-row-title { @apply min-w-0 flex-1 truncate; }
.source-status, .source-row-action { @apply shrink-0 rounded px-1 text-[10px]; }
.source-status.is-ok { @apply bg-emerald-100 text-emerald-700; }
.source-status.is-muted { @apply bg-slate-200 text-slate-600; }
.picture-candidate { @apply grid grid-cols-[72px_minmax(0,1fr)] items-center gap-2 border-b border-slate-200 p-1 text-[10px]; }
.picture-candidate img { @apply h-16 w-[72px] object-contain; }
.picture-candidate span { @apply min-w-0 truncate; }
@media (max-width: 980px) {
.catalog-screen { @apply block; }
.control-panel { @apply min-h-0 grid grid-cols-2; }
.control-panel > * { @apply min-w-0; }
.app-status, #settingsButton { @apply col-span-2; }
.product-panel { @apply pt-0; }
.table-wrap { @apply max-h-[70vh]; }
}
}