# backdropInvert

> Inverts the colours showing through the element's translucent background.

```ts
import { backdropInvert } from "@sdxc/u/effects";
```

Inverts the colours showing through the element's translucent background.
Composes with every other backdrop utility through the shared composite
`backdropFilter`; wrap in `u.transparencySafe()` for a solid fallback.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.backdropInvert()` | `css({ "--ui-backdrop-invert": "1", backdropFilter: "... invert(var(--ui-backdrop-invert, 0)) ...", WebkitBackdropFilter: "... invert(var(--ui-backdrop-invert, 0)) ..." })` |
| `u.transparencySafe(u.backdropInvert(0.15))` | `css({ "@media (prefers-reduced-transparency: no-preference)": { "--ui-backdrop-invert": "0.15", backdropFilter: "...", WebkitBackdropFilter: "..." } })` |

## Examples

### Basic example

Use `backdropInvert(n)` to invert the colors showing through an element, where `backdropInvert()` with no argument inverts them fully:

```tsx
<div mix={[...]}>
	<div mix={[...]}>
		<div mix={[backdropInvert(0.25), ...]}>backdropInvert(0.25)</div>
	</div>
	<div mix={[...]}>
		<div mix={[backdropInvert(), ...]}>backdropInvert()</div>
	</div>
</div>
```

## Applying on a state

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

```ts
u.hover(u.backdropInvert())
```

## Responsive design

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

```ts
u.at("md", u.backdropInvert())
```

## Signature

```ts
u.backdropInvert(value?: number | (string & {}))
```
