# backdropBrightness

> Scales the backdrop's lightness — below `1` darkens, above `1` brightens — keeping overlaid text legible.

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

Scales the backdrop's lightness — below `1` darkens, above `1` brightens —
keeping overlaid text legible. Needs a partly transparent host background;
combines with sibling backdrop utilities; `u.transparencySafe()` gates it.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.backdropBrightness()` | `css({ "--ui-backdrop-brightness": "1.1", backdropFilter: "... brightness(var(--ui-backdrop-brightness, 1)) ...", WebkitBackdropFilter: "... brightness(var(--ui-backdrop-brightness, 1)) ..." })` |
| `u.transparencySafe(u.backdropBrightness(0.8))` | `css({ "@media (prefers-reduced-transparency: no-preference)": { "--ui-backdrop-brightness": "0.8", backdropFilter: "...", WebkitBackdropFilter: "..." } })` |

## Examples

### Basic example

Use `backdropBrightness(n)` to darken what shows through an element below `1`, or brighten it above `1`:

```tsx
<div mix={[...]}>
	<div mix={[...]}>
		<div mix={[backdropBrightness(0.5), ...]}>backdropBrightness(0.5)</div>
	</div>
	<div mix={[...]}>
		<div mix={[backdropBrightness(1.5), ...]}>backdropBrightness(1.5)</div>
	</div>
</div>
```

## Applying on a state

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

```ts
u.hover(u.backdropBrightness())
```

## Responsive design

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

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

## Signature

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