Dark Mode Contact Form (HTML + CSS)
A contact form that respects the visitor's OS dark-mode preference automatically. Pure CSS, no JavaScript theme switcher, no library — uses prefers-color-scheme media queries.
OS-level dark mode is the standard in 2026 — every modern browser supports prefers-color-scheme and most visitors have a preference set. A contact form that respects that preference looks polished without any JavaScript or theme-toggle UI. The trick is using CSS custom properties for color tokens and a single @media (prefers-color-scheme: dark) override.
- →Basic contact form · 4 fields
- →HTML, JS, React, PHP, cURL outputs
- →One POST endpoint, no SDK
- →Honeypot + classifier, no CAPTCHA
See exactly what your visitors see — and you’ll receive.
Left: the rendered form, fully interactive in a sandboxed iframe. Right: the email and dashboard view that lands the moment a visitor submits.
Every submission becomes an email plus a dashboard row. The fields below are the exact payload your form will send. Reply-to is wired to the visitor’s email so hitting reply goes back to them.
Iframe is sandboxed — submit doesn’t actually fire. Get your access key to wire it up live.
Generate, embed, receive.
Three actions stand between you and your first lead. None of them require a backend, a database, or a CAPTCHA library.
Define color tokens
Set --bg, --ink, --line, --accent in :root. These are your light-mode values.
Override for dark mode
Inside @media (prefers-color-scheme: dark), redefine the same tokens with dark-friendly values. Every color in your form references the tokens, so the whole thing flips.
(Optional) Add a manual toggle
If you want a manual override, add a `data-theme` attribute on `<html>` and additional CSS selectors. Most sites don't need this — system preference is enough.
Five outputs. One backend.
HTML by default. Click open the language you ship in — every variant POSTs to the same /api/submit endpoint.
Replace YOUR_ACCESS_KEY with the key from your dashboard. That’s the only edit.
One template. Every framework.
The same field set works on every framework splitforms supports. HTML, React, Next.js, Vue, Astro, Hugo, WordPress — same POST, same backend.
Things people ask before they ship.
Direct answers, no marketing fluff. Missing one? Email hello@splitforms.com.
Ship your dark mode contact form (html + css) in 60 seconds.
1,000 free submissions per month. No credit card. Copy the snippet, paste your access key, watch leads land in your inbox.