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