This project styles a receipt dashboard whose HTML keeps the record list before the action rail. CSS allocates space without changing that order.
CSS receipt dashboard project: one layout across cards, rails, and zoom
How the rule works
The outer dashboard begins as one column and grows to two when the rail fits. Each card's slot is its own query container, so a card placed in the main grid or a narrower rail can choose its layout from the space it actually receives. The controls wrap instead of clipping. Keep status words in the HTML, and provide a visible focus indicator through the shared control styles. The sample is the core stylesheet, not an entire application: data fetching, record authorization, and the action endpoints must be implemented separately. Test one empty record, a very long identifier, and a card with a translated title before presenting it as ready.
.receipt-dashboard { display: grid; gap: 1.25rem; }
@media (min-width: 58rem) {
.receipt-dashboard { grid-template-columns: minmax(0, 1fr) 17rem; }
}
.receipt-card-slot { container-type: inline-size; min-inline-size: 0; }
.receipt-card { display: grid; gap: .75rem; padding: 1rem; border: 1px solid #b7c4d1; }
@container (min-width: 32rem) {
.receipt-card { grid-template-columns: minmax(0, 1fr) auto; }
}
.receipt-actions { display: flex; flex-wrap: wrap; gap: .5rem; }Cost and verification
The stylesheet adds no image or script request. Layout work grows with the number of cards, so paginate or otherwise bound very large result sets based on actual measurement. Check 320-pixel width, 200% zoom, a long status phrase, and keyboard traversal through the actions. Do not treat a CSS project as proof that the record service exists; the HTML project supplies structure, and a backend must own state changes.
Common Mistakes
- Do not use grid order to move a rail ahead of the record in paint while leaving focus order behind.
- Do not assume a card in the sidebar has the same width as a card in the main region.
- Do not present action buttons as functional without handlers and authorization.
