This Tailwind CSS cut out effect will amaze you

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Glad you like it Braydon. I really wish I could use this effect more often in my projects.
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

A while a go we created this super cool cut out text effect in CSS, however in today's article we'll have a look at how to do this in Tailwind CSS.
The result will be this super amazing, yet simple to achieve effect.
As for the HTML structure, we only need two elements.
<div>
<h1>BOTANY</h1>
</div>
That is all that we need, and with the help of Tailwind CSS we can easily create this amazing cut out effect.
Note: Check out this article for integrating Tailwind in your project
To generate this effect, lets first focus on giving out div a background image. This will be the only custom part to the setup, however when you are using Tailwind in your project you can use the tailwind config for this.
.background {
background-image: url('https://images.pexels.com/photos/797797/pexels-photo-797797.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940');
}
Then we can add some classes to center this background and make it cover the whole area.
<div class="background bg-cover bg-center"></div>
The second part to this tutorial is to style the h1 element.
Let's start by making it a big bigger and bold.
<h1 class="font-bold text-9xl">BOTANY</h1>
And the magic comes with the following three classes, we want our text to be the opposite of our background, and then use the blend mode to get the effect we need.
<h1 class="font-bold text-9xl mix-blend-lighten text-black bg-white">BOTANY</h1>
And that's it we now have a stunning CSS cutout text effect using Tailwind CSS.

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter