A deep dive into complex CSS gradients and multiple backgrounds to recreate the iconic Jolly Roger of the Straw Hat Pirates. This artwork uses no images or SVG.
hibuno
••3 min read•
#css-art#one-piece#gradient#jolly-roger#anime
Preview
Thanks for reading!
If you found this article helpful, maybe you could help share it.
This tutorial demonstrates how to leverage advanced CSS techniques—specifically, multiple radial-gradient and linear-gradient layers—to draw detailed illustrations, such as the famous Straw Hat Pirates flag from *One Piece*, using only one HTML element.
The Technique: Layering Backgrounds
The entire skull and crossbones is constructed by layering various gradients within the background property of the main element (.one-piece) and its pseudo-elements (::before and ::after). Each gradient line and circle is a separate layer.
1. The HTML Structure
We use a single container element, setting a CSS Variable (--s) for easy scaling of the entire flag.
<div class="one-piece"></div>
2. The CSS: Building the Skull
The main class .one-piece handles the skull, the crossbones (implicitly), and the distinctive straw hat. The layering is critical, starting from the skull's core and moving outward to the hat's details.
The ::before element is used to draw the crossbones, using multiple black linear gradients for the bone shape and white as the background color. The ::after element is used primarily for the **black circular flag background** and adds a subtle blurred border effect.
By carefully positioning and sizing dozens of simple gradients on three stacked elements, we successfully render a recognizable, complex graphic. This method showcases the power of pure CSS for graphic creation.
Drawing the One Piece Straw Hat Pirate Flag | Hibuno