size
padding-bottom
Pads the given physical side by its env(safe-area-inset-{side}) value, falling back to fallback ("0px" by default) on platforms with no safe area to avoid.
import { safeAreaPadding } from "@sdxc/u/size";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.safeAreaPadding("bottom") | css({ paddingBottom: "env(safe-area-inset-bottom, 0px)" }) |
u.safeAreaPadding("top", "1rem") | css({ paddingTop: "env(safe-area-inset-top, 1rem)" }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.safeAreaPadding("bottom")Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.safeAreaPadding("bottom"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.safeAreaPadding("bottom"))Signature
u.safeAreaPadding(side: SafeAreaSide, fallback?: string)