Filters
Utilities for applying backdrop invert filters to an element.
Class | Styles |
---|---|
backdrop-invert | backdrop-filter: invert(100%); |
backdrop-invert-<number> | backdrop-filter: invert(<number>%); |
backdrop-invert-(<custom-property>) | backdrop-filter: invert(var(<custom-property>)) |
backdrop-invert-[<value>] | backdrop-filter: invert(<value>); |
Use utilities like backdrop-invert
and backdrop-invert-65
to control the color inversion of an element's backdrop:
Use the backdrop-invert-[<value>]
syntax to set the backdrop inversion based on a completely custom value:
<div class="backdrop-invert-[.25] ..."> <!-- ... --></div>
For CSS variables, you can also use the backdrop-invert-(<custom-property>)
syntax:
<div class="backdrop-invert-(--my-backdrop-inversion) ..."> <!-- ... --></div>
This is just a shorthand for backdrop-invert-[var(<custom-property>)]
that adds the var()
function for you automatically.
Prefix a backdrop-filter: invert()
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="backdrop-invert-0 md:backdrop-invert ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.