Ten rules for calmer interfaces
Mar 12 · 5 min read
A food blog recipe card with a round dish image breaking out of the top and time, servings and level.
<article class="recipe-card">
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='19' fill='%23fafaf9'/%3E%3Ccircle cx='20' cy='20' r='13' fill='%23fcd34d'/%3E%3Cpath d='M11 18c4-3 6 3 10 0s6 3 9 0M11 23c4-3 6 3 10 0s6 3 9 0' fill='none' stroke='%23f59e0b' stroke-width='1.5'/%3E%3Ccircle cx='16' cy='15' r='1.5' fill='%2365a30d'/%3E%3Ccircle cx='25' cy='26' r='1.5' fill='%2365a30d'/%3E%3Ccircle cx='23' cy='14' r='1.2' fill='%23dc2626'/%3E%3C/svg%3E" alt="Lemon herb pasta on a white plate" width="96" height="96">
<h3><a href="#">Lemon Herb Pasta</a></h3>
<ul class="recipe-card-meta">
<li><b>25</b> min</li>
<li><b>2</b> servings</li>
<li><b>Easy</b> level</li>
</ul>
</article>
.recipe-card {
width: 220px;
margin-top: 48px;
padding: 0 16px 16px;
border-radius: 20px;
background: #fff;
box-shadow: 0 12px 28px -14px rgba(146, 64, 14, 0.4);
color: #451a03;
font-family: system-ui, sans-serif;
text-align: center;
}
.recipe-card img {
display: block;
width: 96px;
height: 96px;
margin: -48px auto 0;
border-radius: 50%;
box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.3);
transition: transform 0.6s ease;
}
.recipe-card:hover img {
transform: rotate(40deg);
}
.recipe-card h3 {
margin: 10px 0 12px;
font-size: 16px;
}
.recipe-card h3 a {
color: inherit;
text-decoration: none;
}
.recipe-card h3 a:focus-visible {
outline: 2px solid #d97706;
outline-offset: 2px;
}
.recipe-card-meta {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin: 0;
padding: 10px 0 0;
border-top: 1px solid #fef3c7;
list-style: none;
color: #92400e;
font-size: 11px;
}
.recipe-card-meta b {
display: block;
color: #451a03;
font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
.recipe-card img {
transition: none;
}
}
This CSS Recipe Card is 63 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
The colors in this snippet. Search and replace them to match your brand:
#fff#451a03#d97706#fef3c7#92400e<style> tag..recipe-card class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.