DEV Community

Cover image for The ChocoDEV Signature Bar: one chocolate bar, zero images
Vinicius Pereira
Vinicius Pereira

Posted on

The ChocoDEV Signature Bar: one chocolate bar, zero images

Frontend Challenge CSS Art Submission 🍲🥧

This is a submission for Frontend Challenge: Comfort Food Edition, CSS Art.

Inspiration

Yesterday I submitted a landing page for ChocoDEV, a chocolate brand that exists only in CSS. A brand needs a product shot, and this brand has a rule: no images, ever. So the product shot had to be drawn in the only medium the brand allows.

It is one chocolate bar with a bite taken out of it, because a perfect untouched bar is a lie. Nobody photographs their comfort food before tasting it.

Demo

Live: vinimabreu.dev/chocodev/bar

The fallen chunk reacts if you click it. That is the entire JavaScript budget, three lines, and the piece is complete without them.

The ChocoDEV Signature Bar, a CSS chocolate bar with a bite taken out

Journey

Every chunk is a molded facet: four trapezoid faces built from angular gradients, so the light lands differently on each slope, the way a real mold presses chocolate. The letters are not printed on top, they are pressed in, one dark shadow above and one thin highlight below, and that two-shadow trick is the whole illusion of depth.

The bite was the hard part. A clean clip-path zigzag looked like scissors had done it, so the exposed edge got fracture facets in lighter matte browns and a few crumbs, because chocolate never breaks politely.

Close up of the bite edge, fracture facets and crumbs, with the fallen S chunk

There is exactly one animation, a slow sheen that crosses the bar like it is turning under a studio light, and it sits behind a prefers-reduced-motion guard. When your system asks for stillness, the bar just stands there looking edible.

Everything is gradients, box-shadow, border-radius and clip-path. Open devtools, it is chocolate all the way down.

Top comments (0)