Filters

Contrast v1.0.9

Utilities for sets contrast filter to an element.


Class

classcss
filter {contrast}filter: brightness(var(--brightness)) contrast(var(--contrast)) saturate(var(--saturate)) blur(var(--blur)) drop-shadow(var(--drop-shadow))
classcss
contrast-0--contrast: 0
contrast-1--contrast: 1
contrast-2--contrast: 1.10
contrast-3--contrast: 1.20
contrast-4--contrast: 1.30
contrast-5--contrast: 1.40
contrast-6--contrast: 1.50
contrast-7--contrast: 1.60
contrast-8--contrast: 1.70
contrast-9--contrast: 1.80
contrast-10--contrast: 1.90
Note: Only supported web browsers can benefit from this utility.

Usage

Filter: OFFFilter: ON

Apply the filter class first, and then set the filter in any order when with other filters.

<!-- Example -->
<img class="filter contrast-10 ..."
src="...">


<y class="filter contrast-10 ..."
style
="background-image:url(...)"
>
</y>

Mix with other filters, such as Brightness, Saturate, Blur and Drop Shadow.

<!-- Example -->
<img class="filter contrast-10 brightness-10 saturate-5 blur-5 drop-shadow-md ..."
src="...">


<y class="filter contrast-10 brightness-10 saturate-5 blur-5 ..."
style
="background-image:url(...)"
>
</y>

Customize More

// @file: `src/_plugins.scss`
@include plugin(
(
utility: 'filter.contrast',
//variant: 'responsive',
property: '--contrast',
modifier: (
'contrast-11': '...',
'contrast-12': '...'
//...
)
)
)

Variant

VariantEnabledResponsive
DefaultYes
Dark Theme
hover
group-hover
focus
focus-within
active
visited
checked
disabled