This is a submission for Frontend Challenge - Comfort Food Edition, CSS Art.
Inspiration
For me, comfort food has always been Golgappe (also known as Pani Puri or Puchka).
Whether it was celebrating acing an exam, buying a new gadget, having a rough day and needing to let things go, or sharing festive sweets during Diwali, a plate of crisp, golden puris loaded with spiced potatoes, sprouts, chickpeas, sweet tamarind chutney, and fiery mint-coriander water has always been the ultimate reset button.
I wanted to capture that nostalgic street-cart experience entirely in HTML and CSS—without SVGs, raster images, or canvas.
Live Demo & Code
- 🌐 Live Demo: View on GitHub Pages / CodePen
- 💻 Source Code: GitHub Repository
How It's Built: 100% Pure CSS Art
The entire scene is constructed from semantic HTML elements and styled exclusively with modern CSS techniques:
-
Dual-Layer Scene Composition:
- Background: The iconic street-side food cart with its striped awning, wooden posts, hand-painted sign, glass display showcase with stacked puris, and a cloth-draped terracotta matka (earthen pot) filled with chilled mint water.
- Foreground: A traditional steel serving plate featuring four crisp whole puris, a sliced lemon wedge, pickled red onion rings, chickpea masala, a glass of spiced pudina water, and a hero broken puri showing off its layered fillings.
-
Lighting Model & Material Shading:
- Consistent upper-left key light token (
--key-x: 28%,--key-y: 18%). - Layered
radial-gradient(),conic-gradient(), andlinear-gradient()combinations simulate fried blistered dough, glistening tamarind chutney, and metallic plate reflections.
- Consistent upper-left key light token (
-
Pure CSS Motion & Accessibility:
- Atmospheric steam wisps rising from the freshly dressed puri via
@keyframes steam-rise. - Keyboard navigable with
:focus-visibleand interactive hover specular glints. - Respects user accessibility preferences with
@media (prefers-reduced-motion: reduce).
- Atmospheric steam wisps rising from the freshly dressed puri via
The AI Iteration & Audit Workflow
Full transparency: I am not a seasoned digital artist, and designing high-fidelity CSS art from scratch manually is daunting. To create this artwork, I built an automated Generator-Critic Architecture using dedicated GitHub prompt definitions:
-
The Builder (
.github/prompts/css-food-art.prompt.md): Role-plays a Senior CSS Artist & Lighting Director that strictly generates structural plans (PLAN.md) and writes semantic, pure CSS illustrations following rigorous lighting and texture principles. -
The Judge / Critic (
.github/prompts/css-art-audit.prompt.md): Role-plays a veteran CSS Art Competition Judge that inspects rendered screenshots and audits the code against a 10-point scoring rubric (1–10 scale across visual fidelity, lighting consistency, composition, contrast, and accessibility).
The Evolution Across 6 Audit Iterations
Through 6 structured audit rounds, the artwork progressed from a flat baseline into a competition-ready street food scene:
What Changed: Before vs. After Fine-Tuning
| Dimension | Initial AI Output (Iteration 1) | Fine-Tuned Final Output (Iteration 6) |
|---|---|---|
| Plating & Perspective | Flat top-down circle pasted onto angled canvas | 3D elliptical stainless steel thali with raised rim lip, inner well shadow, and symmetric puri placement |
| Hero Puri Filling | Muddy brown silhouette with flat icon dots | Visible individual chickpeas, potato cubes, crispy sev nest, cilantro, and glistening overhanging tamarind chutney drip |
| Street-Cart Atmosphere | Static background with no motion | Animated rising steam wisps, gentle canopy sway, and shimmering pudina water ripple |
| Lighting Consistency | Random shadow angles (downward and centered) | Mathematically unified upper-left key light (--key-x: 28%, --key-y: 18%) with coherent lower-right cast shadows |
| Cart Props & Midground | Floating matka, empty counter gaps, rigid waffle-grid puris | Grounded terracotta matka with draped cloth & garland, 2 condiment counter bowls (chopped onions & lemons), organic mini-puri stack |
| Perspective Scale | Uniformly sized puris in both foreground and background | Depth-aware scaling: small puris in background cart box; balanced proportion on serving plate |
| Code & Architecture | 20 repeating DOM spans + runtime JavaScript dependency |
100% Pure CSS (0 JS), semantic HTML, CSS tokens (:root), and complete @media (prefers-reduced-motion) support |
Tech Stack
- HTML5: Semantic tags, ARIA attributes, and accessible structure.
-
CSS3: Custom Properties, complex gradient stacks, CSS Grid/Flexbox, Keyframe animations, and
@mediaqueries. - JavaScript: 0 KB (Pure CSS, zero runtime script overhead).



Top comments (0)