File: filter-invert.md | Updated: 11/15/2025
⌘KCtrl KDocs Blog Showcase Sponsor Plus
Filters
Utilities for applying invert filters to an element.
| Class | Styles |
| --- | --- |
| invert | filter: invert(100%); |
| invert-<number> | filter: invert(<number>%); |
| invert-(<custom-property>) | filter: invert(var(<custom-property>)); |
| invert-[<value>] | filter: invert(<value>); |
Use utilities like invert and invert-20 to control the color inversion of an element:
invert-0
invert-20
invert
<img class="invert-0" src="/img/mountains.jpg" /><img class="invert-20" src="/img/mountains.jpg" /><img class="invert" src="/img/mountains.jpg" />
Use the invert-[<value>] syntax to set the color inversion based on a completely custom value:
<img class="invert-[.25] ..." src="/img/mountains.jpg" />
For CSS variables, you can also use the invert-(<custom-property>) syntax:
<img class="invert-(--my-inversion) ..." src="/img/mountains.jpg" />
This is just a shorthand for invert-[var(<custom-property>)] that adds the var() function for you automatically.
Prefix a filter: invert() utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<img class="invert md:invert-0 ..." src="/img/mountains.jpg" />
Learn more about using variants in the variants documentation .
Copyright © 2025 Tailwind Labs Inc.·Trademark Policy