Card

Card is a component that provides default border and padding values. It also contains Card-split which lets you divide cards up into several sections effortlessly.


Nothing special on first glance

It just provides default padding and border values so you can create cards easily.

index.html
<div class="Card">...</div>
Card content

But when you need advanced cards…

You can use Card-split which lets you create cards that can easily be divided into multiple sections.

index.html
<div class="Card-split">
<div>One</div>
<div>Two</div>
</div>
One
Two

Include Dividers with ease too

Card-split works flawlessly with Divider and DividerBetween to create dividers as you wish.

index.html
<div class="Card-split DividerBetween-horizontal">
<div>One</div>
<div>Two</div>
</div>
Just one divider here
One
Two

Make complex cards just by writing some markup

We hope you never have to make monstrous cards, but if you ever need to, just know that it’s pretty easy.

Card-split and DividerBetween goes a long way to make almost any card you can imagine.

index.html
<div class="Card-split Vertical DividerBetween-x">
<div>One</div>
<div class="Card-split SimpleGrid [--cols:2] DividerBetween-y">
<div>Two</div>
<div class="Card-split DividerBetween-x">
<div>Three</div>
<div>Four</div>
</div>
</div>
<div>Five</div>
</div>
You could go nuts if you want to 😵‍💫
One
Two
Three
Four
Five

Uniform padding and border inside Card-split

Keeping padding and border styles consistent is a cinch if you change the --padding and border variables we provide. Just check this demo out!

index.html
<div
class="Card-split ..."
style="--padding: <value>; --border-width: <value>"
>
...
</div>
Padding
1rem
Border Width
1px
One
Two
Three
Four
Five

Automatic nested border radius too

--nudge inside Card-split also creates automatic nested border radius calculation. So you can get beautiful cards with much less work.

index.html
<div class="Card-split" style="--radius: 1rem">
<div style="--nudge: 0.25rem">One</div>
<div>Two</div>
</div>
Magnificento
One
Two