Filters
Utilities for applying backdrop filters to an element.
Class | Styles |
---|---|
backdrop-filter-none | backdrop-filter: none; |
backdrop-filter-(<custom-property>) | backdrop-filter: var(<custom-property>); |
backdrop-filter-[<value>] | backdrop-filter: <value>; |
Use utilities like backdrop-blur-xs
and backdrop-grayscale
to apply filters to an element's backdrop:
You can combine the following backdrop filter utilities: blur, brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, and sepia.
Use the backdrop-filter-none
utility to remove all of the backdrop filters applied to an element:
<div class="backdrop-blur-md backdrop-brightness-150 md:backdrop-filter-none"></div>
Use the backdrop-filter-[<value>]
syntax to set the backdrop filter based on a completely custom value:
<div class="backdrop-filter-[url('filters.svg#filter-id')] ..."> <!-- ... --></div>
For CSS variables, you can also use the backdrop-filter-(<custom-property>)
syntax:
<div class="backdrop-filter-(--my-backdrop-filter) ..."> <!-- ... --></div>
This is just a shorthand for backdrop-filter-[var(<custom-property>)]
that adds the var()
function for you automatically.
Prefix a backdrop-filter
utility with a variant like hover:*
to only apply the utility in that state:
<div class="backdrop-blur-sm hover:backdrop-filter-none ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.
Prefix a backdrop-filter
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="backdrop-blur-sm md:backdrop-filter-none ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.