DEV Community

Cover image for How to design Unique shapes using TailwindCSS
Darpan Vithani for Canopas Software

Posted on

How to design Unique shapes using TailwindCSS

CSS is used for more than just styling elements. CSS shapes enable web designers to create custom paths such as triangles, circles, and polygons. ⚪️, 🔷, 🔺, ⭐️, ◾️.

This way, you’re not forced to insert a transparent-background floating image only to be disappointed by a rectangular box around it.

This article will design various shapes using TailwindCSS and a few functional shapes and values.

Tailwind CSS can be used to create various shapes using its pre-defined classes.

You can make shapes such as circles, squares, triangles, and more using the .rounded-* classes for rounded shapes and the .w-* and .h-* classes for width and height.

Additionally, you can create shapes using the :before and :after pseudo-elements with the content property set to an empty string and the border property set to create the desired shape.

And you’ll see how simple a task like this can be if you sharpen your skills and practice regularly.

For a detailed implementation guide, check out our canopas blog.

Top comments (1)

Collapse
 
vincentdorian profile image
Vincent

I really like this article! Awesome stuff. 🎉