color
autofill
Overrides the browser's autofill background and text color under &:-webkit-autofill, so an autofilled input keeps the appearance every other input has.
import { autofill } from "@sdxc/u/color";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.autofill() | css({ "&:-webkit-autofill": { boxShadow: "0 0 0 1000px var(--ui-bg, Canvas) inset !important", WebkitBoxShadow: "0 0 0 1000px var(--ui-bg, Canvas) inset !important", WebkitTextFillColor: "var(--ui-fg, CanvasText) !important" } }) |
Examples
Calls that compose other mixins rather than emitting declarations of their own.
u.autofill("neutral.tint", "neutral")Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.autofill()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.autofill())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.autofill())Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-bg |
--ui-fg |
Signature
u.autofill(background?: ColorValue | (string & {}), foreground?: ColorValue | (string & {}))