Backdrop Sepia In Tailwind CSS

In this article, we will explore more about Tailwind Backdrop Sepia class with examples. Backdrop Sepia is a new class that belongs to the Backdrop Filter module.

This module includes several filters that can be applied to an element’s backdrop, such as blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, and sepia. However, not all browsers support this module yet.

Tailwind Backdrop Sepia

Fortunately, Tailwind allows you to use Backdrop Sepia in any browser, as it includes a fallback system that provides a similar effect using other CSS properties.



Tailwind Backdrop Sepia

Tailwind Backdrop Sepia class applies a sepia filter to an element’s backdrop.

This filter can be adjusted to any degree of sepia intensity, from 0% (no sepia) to 100% (full sepia).

This feature was first included in version 2.1 of Tailwind CSS.

Syntax:

<element class="filter backdrop-sepia |backdrop-sepia-0"></element>

Tailwind Backdrop Sepia Values

  • backdrop-sepia-0 : This class represents the original image, with no sepia effect. In regular CSS, it is equivalent to backdrop-filter: sepia(0);
  • backdrop-sepia : This class represents the sepia image, with a 100% sepia effect. In regular CSS, it is equivalent to backdrop-filter: sepia(100%);

you can use either backdrop-sepia or backdrop-sepia-0, depending on the desired effect.

The pipe symbol (|) indicates that you can only use one of the classes.

Here’s an example of using Backdrop Sepia classes:

Example: 

<!DOCTYPE html> <html> <head> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="text-center mx-4 "> <h1 class="text-gray-600 text-2xl font-semibold"> MrExamples </h1> <p class="font-semibold my-2">Backdrop Sepia Class in Tailwind CSS</p> <div class=" mx-16 mt-18 h-36 relative"> <div class="absolute w-full h-full py-18"> <img class="rounded-lg object-cover h-full w-full" src="https://mrexamples.com/wp-content/uploads/2023/02/tailwind1.webp" alt="image"> </div> <div class="relative h-36 flex overflow-x-auto space-x-4 font-semibold text-white"> <div class="flex-shrink-0 border-2 border-gray-500 backdrop-filter backdrop-sepia-0 w-1/2"> backdrop-sepia-0 (default) </div> <div class="flex-shrink-0 border-2 border-gray-500 backdrop-filter backdrop-sepia w-1/2"> backdrop-sepia </div> </div> </div> </body> </html>
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *