sdxc

[ @sdxc/u/effects ]

backdropSepia

Shifts what shows through the element's translucent background toward a warm brown monochrome.

import { backdropSepia } from "@sdxc/u/effects";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.backdropSepia()css({ "--ui-backdrop-sepia": "1", backdropFilter: "... sepia(var(--ui-backdrop-sepia, 0))", WebkitBackdropFilter: "... sepia(var(--ui-backdrop-sepia, 0))" })
u.transparencySafe(u.backdropSepia(0.6))css({ "@media (prefers-reduced-transparency: no-preference)": { "--ui-backdrop-sepia": "0.6", backdropFilter: "...", WebkitBackdropFilter: "..." } })

Examples

Basic example

Use backdropSepia(n) to tone what shows through an element toward warm brown, where backdropSepia() with no argument converts it fully:

backdropSepia(0.5)
backdropSepia()
<div mix={[...]}>
	<div mix={[...]}>
		<div mix={[backdropSepia(0.5), ...]}>backdropSepia(0.5)</div>
	</div>
	<div mix={[...]}>
		<div mix={[backdropSepia(), ...]}>backdropSepia()</div>
	</div>
</div>

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.backdropSepia())

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.backdropSepia())

Signature

u.backdropSepia(value?: number | (string & {}))

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.