brewlog/templates/styles.css
Jon Seager 8c521f0e05
feat(data): redesign mobile data page with card layout and tab selector
- Add collapsible mobile tab selector with chevron icons
- Integrate search bar into tab component (below tabs)
- Replace Datastar search handler with vanilla JS for reliability
- Add mobile card layout: card-title, card-date, card-actions classes
- Add three-dot action menu for mobile with details/summary pattern
- Hide duplicate search inside data-content via CSS
- Pass search_value to DataTemplate for input preservation
2026-02-04 22:22:18 +00:00

381 lines
8.3 KiB
CSS

:root {
color-scheme: light;
}
body {
font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a {
text-decoration: none;
}
.input-field {
width: 100%;
min-width: 0;
border-radius: 0.5rem;
border: 1px solid rgba(120, 53, 15, 0.3);
background-color: rgba(254, 243, 199, 0.85);
padding: 0.6rem 0.75rem;
color: #4a2f0b;
transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input-field:focus {
outline: none;
border-color: rgba(180, 83, 9, 0.6);
box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.2);
}
.btn-adjust {
display: flex;
height: 2rem;
width: 2rem;
align-items: center;
justify-content: center;
border-radius: 0.375rem;
border: 1px solid rgba(245, 158, 11, 1);
background-color: transparent;
color: rgba(180, 83, 9, 1);
font-weight: 700;
transition: background-color 150ms ease;
}
.btn-adjust:hover {
background-color: rgba(255, 251, 235, 1);
}
/* Timeline layout */
/* Mobile: single column, centred line behind cards */
.timeline-line {
left: 50%;
transform: translateX(-50%);
}
.timeline-item {
padding-left: 0;
}
.timeline-node {
left: 50%;
top: -10px;
transform: translateX(-50%);
z-index: 2;
}
.timeline-heading {
position: sticky;
top: 0;
z-index: 10;
background-color: #fefce8; /* amber-50, matches page background */
padding-top: 1rem;
padding-bottom: 1rem;
border-bottom: 2px solid transparent;
transition: border-color 0.15s ease;
text-align: center;
}
.timeline-heading.is-stuck {
border-bottom-color: #b45309; /* amber-700 */
}
.timeline-top-btn {
display: none;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
padding: 0.25rem;
color: #b45309; /* amber-700 */
opacity: 0.7;
transition: opacity 0.15s ease;
}
.timeline-top-btn:hover {
opacity: 1;
}
.timeline-heading.is-stuck .timeline-top-btn {
display: block;
}
/* Hide duplicate search inside data page - search is in the tab bar */
.data-page-content section:has(.responsive-table) > div:first-child:has(input[type="search"]) {
display: none;
}
/* Remove extra margin from list containers inside data page */
.data-page-content > div[id$="-list"] {
margin-top: 0;
}
/* Responsive tables: convert rows to cards on mobile */
@media (max-width: 767px) {
/* Remove outer section border/background on mobile - cards are standalone */
section:has(.responsive-table) {
border: none !important;
background: transparent !important;
box-shadow: none !important;
padding: 0 !important;
}
/* Search header: remove wrapper styling, let input fill width */
section:has(.responsive-table) > div:first-child:has(input[type="search"]) {
border: none !important;
background: transparent !important;
padding: 0 !important;
margin-bottom: 1rem;
}
/* Remove overflow wrapper styling */
section:has(.responsive-table) > .overflow-x-auto {
overflow: visible;
}
.responsive-table {
border: none !important;
background: transparent !important;
box-shadow: none !important;
}
/* Remove divide-y borders from table */
.responsive-table,
.responsive-table tbody {
border-color: transparent !important;
}
.responsive-table thead {
display: none;
}
.responsive-table tbody {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0;
}
/* Match home page brew card style */
.responsive-table tr {
display: flex;
flex-direction: column;
position: relative;
padding: 1rem;
border-radius: 0.5rem;
border: 1px solid #fde68a !important; /* amber-200 */
background-color: #fffbeb; /* amber-50 */
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}
.responsive-table td {
display: flex;
justify-content: space-between;
align-items: baseline;
padding: 0.25rem 0;
white-space: normal;
font-size: 0.875rem;
border: none !important;
}
.responsive-table td::before {
content: attr(data-label);
flex-shrink: 0;
min-width: 5.5rem;
font-size: 0.8125rem;
font-weight: 500;
color: #78716c; /* stone-500 - more muted like brew card */
margin-right: 0.75rem;
}
.responsive-table td[data-label=""]::before {
display: none;
}
.responsive-table td.mobile-hidden {
display: none;
}
/* Card title: header section with bottom divider */
.responsive-table td.card-title {
order: -2;
padding: 0 0 0.5rem 0;
padding-right: 2.5rem;
margin-bottom: 0.5rem;
border-bottom: 1px solid #fef3c7 !important; /* amber-100 */
}
.responsive-table td.card-title,
.responsive-table td.card-title > :first-child {
font-size: 1rem;
font-weight: 600;
color: #92400e; /* amber-800 */
}
.responsive-table td.card-title::before {
display: none;
}
/* "Added" date: footer section with top divider */
.responsive-table td.card-date {
order: 99;
padding-top: 0.5rem;
margin-top: 0.5rem;
border-top: 1px solid #fef3c7 !important; /* amber-100 */
font-size: 0.75rem;
color: #78716c;
}
.responsive-table td.card-date::before {
font-size: 0.75rem;
font-weight: 500;
color: #78716c;
min-width: auto;
margin-right: 0.5rem;
}
/* Actions: absolute top-right in header area */
.responsive-table td.card-actions {
order: -1;
position: absolute;
top: 0.75rem;
right: 0.75rem;
padding: 0;
justify-content: flex-end;
}
.responsive-table td.card-actions::before {
display: none;
}
/* Three-dot dropdown menu */
.card-menu {
position: relative;
}
.card-menu summary {
list-style: none;
cursor: pointer;
display: inline-flex;
height: 2rem;
width: 2rem;
align-items: center;
justify-content: center;
border-radius: 0.375rem;
color: #78716c;
transition: color 150ms ease, background-color 150ms ease;
}
.card-menu summary:hover {
color: #b45309;
background-color: rgba(254, 243, 199, 0.8);
}
.card-menu summary::-webkit-details-marker {
display: none;
}
.card-menu[open] summary {
color: #b45309;
background-color: rgba(254, 243, 199, 0.8);
}
.card-menu .card-menu-items {
position: absolute;
right: 0;
top: 100%;
z-index: 20;
min-width: 10rem;
margin-top: 0.25rem;
border-radius: 0.5rem;
border: 1px solid rgba(217, 169, 55, 0.4);
background-color: #fffbeb;
padding: 0.25rem 0;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.card-menu .card-menu-items a,
.card-menu .card-menu-items button,
.card-menu .card-menu-items form button {
display: flex;
width: 100%;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
color: #44403c;
text-align: left;
background: none;
border: none;
cursor: pointer;
transition: background-color 150ms ease;
text-decoration: none;
}
.card-menu .card-menu-items a:hover,
.card-menu .card-menu-items button:hover,
.card-menu .card-menu-items form button:hover {
background-color: rgba(254, 243, 199, 0.6);
}
.card-menu .card-menu-items .menu-item-danger {
color: #dc2626;
}
.card-menu .card-menu-items .menu-item-danger:hover {
background-color: rgba(254, 202, 202, 0.3);
}
.pagination-controls {
display: none;
}
}
/* Desktop: alternating cards with central line */
@media (min-width: 768px) {
.timeline-list {
display: flex;
flex-direction: column;
}
.timeline-item {
width: 50%;
padding-right: 0;
}
/* Reset node to side-of-card positioning on desktop */
.timeline-node {
top: 50%;
transform: translateY(-50%);
}
/* Left side items (odd) - counts only .timeline-item children, skipping month headings */
.timeline-item:nth-child(odd of .timeline-item) {
align-self: flex-start;
padding-right: 2rem;
}
.timeline-item:nth-child(odd of .timeline-item) .timeline-node {
right: -10px;
left: auto;
top: 50%;
transform: translateY(-50%);
}
/* Right side items (even) */
.timeline-item:nth-child(even of .timeline-item) {
align-self: flex-end;
padding-left: 2rem;
}
.timeline-item:nth-child(even of .timeline-item) .timeline-node {
left: -10px;
top: 50%;
transform: translateY(-50%);
}
/* Allow vertical overlap between alternating cards (skip first item) */
.timeline-item + .timeline-item {
margin-top: -4rem;
}
}