Overview
Thelum-card utility creates a consistent card component with automatic spacing, background styling, and smooth rounded corners.
CSS Implementation
Usage
Applied Classes
Thelum-card utility applies the following Tailwind classes:
Layout
flex flex-col- Vertical flexbox layoutgap-3- 0.75rem (12px) spacing between child elements
Typography
whitespace-pre-wrap- Preserves whitespace and line breaks while allowing wrapping
Styling
lum-bg-lum-card-bg- Background color using Luminescent themep-7- 1.75rem (28px) padding on all sidesborder-radius: var(--lum-border-radius)- Rounded cornerscorner-shape: superellipse- Smooth superellipse corners
CSS Variables
Default card background color
Border radius for card corners
Superellipse corner smoothing (0 = circle, 1 = squircle, 2+ = rounded square)
Depth effect intensity (inherited from lum-bg utility)
Customization
Padding
Override the default padding with Tailwind utilities:Gap
Adjust spacing between child elements:Background
Change the background color:Depth Effect
Add depth shadows to the card:Examples
Responsive Design
Interactions
Hoverable Card
Clickable Card
Card with Depth on Hover
The
gap-3 spacing automatically creates consistent vertical rhythm between all child elements. This works well for headings, paragraphs, buttons, and other content.Best Practices
- Use
lum-cardfor grouping related content - Keep card content focused on a single topic or action
- Use consistent padding across cards in the same context
- Consider max-width to prevent cards from becoming too wide
- Use
gap-*utilities to adjust spacing for different content densities - Combine with
lum-hoverablefor interactive cards - Use semantic HTML inside cards (headings, lists, etc.)