Dark theme for Google Forms
Google Forms has no dark mode — an embedded form stays bright white even on a dark website, which looks broken and hurts readability at night. CustomGForm lets you define a second, dark palette for the same form. Visitors whose device is set to dark mode get the dark version automatically, and you can pin the scheme yourself so the form always matches the page around it.
Key capabilities
- A full dark palette alongside your light one — every color you can set in the light theme has a dark counterpart (background, text, links, inputs, borders, buttons, error states)
- Automatic detection of the visitor's
prefers-color-schemesystem setting, with no code on your side - Optional in-form toggle so respondents can switch the scheme themselves; their choice is remembered for that form
- Pin or sync the scheme from your own site with the
data-themeembed attribute (or thethemeReact prop) - Light/Dark preview switch in the customizer, so you tune both palettes without leaving the page
- AI theming generates a matching light and dark palette in one prompt
- Works in both standard and popup embeds, and changes nothing about the data sent to Google Forms
Which scheme a visitor sees
The widget resolves the color scheme in this order — the first match wins:
- The visitor's own choice, if they used the in-form toggle before (stored in their browser, per form)
- The
data-themeattribute on the embed —lightordarkpin the scheme,autodefers to the system - The device's system preference (
prefers-color-scheme), which is also the default whendata-themeis missing or has an unrecognized value
| Option | Type | Description |
|---|---|---|
| data-theme="auto" | default | Follows the visitor's system dark-mode setting. Also used when the attribute is absent. |
| data-theme="dark" | string | Always opens in dark mode, whatever the system setting is. |
| data-theme="light" | string | Always opens in light mode, whatever the system setting is. |
Changing the attribute after the form has loaded re-renders it with the new scheme, so you can wire the form straight into your site's own light/dark switcher.
Dark mode is part of the Custom theme, not a separate addon — turn it on in the same theme customizer panel where you set your light colors. Saving a theme template stores the dark palette too, so a brand theme carries both schemes to your other forms.
Styling the page around the form
While the dark scheme is active, a standard embed adds the class cgf__theme-dark to the form's root
element. Use it as a hook when the surrounding section of your page needs to react to the form's
scheme:
.cgf__theme-dark {
/* your own rules for the dark state */
}If you switch Enable dark mode off and save, the dark palette is removed from the form. Turning it back on starts from the default dark colors again.
Learn more
- How to add dark theme support to a Google Form — step-by-step setup
- Theme customizer — the colors, fonts, and spacing both palettes share
- AI theming — generate light and dark palettes from one prompt