You can keep the original form of input
, textarea
and select
elements but direct browser to render them with dark mode assets.
Safari automatically renders those elements with dark mode assets; if your site reports to browser that it supports dark mode. To report support; set color-scheme
property on :root
. Such as:
:root {
color-scheme: dark;
}
If your site supports both modes:
:root {
color-scheme: light dark;
}
This works for both Mac and iOS version of Safari in version 18.
accent-color
value.