Overview
Gravity Forms are structured so that every element can be targeted and manipulated via CSS. Most elements share reusable class names to affect styling, and many elements have unique IDs that you can use to target specific elements within the form. By using CSS inheritance, you can effectively style every element in your form.
All element IDs follow the form ID and field ID pattern (for example #gform_wrapper_1, #field_1_3). The mockup below uses the Orbital class list produced by the theme framework: wrapper gform-theme--*, hyphenated layout hooks gform-body / gform-footer (with legacy twins gform_body / gform_footer), fields container classes from form settings (form_sublabel_below, description_below, validation_below), and each field’s gfield--type-*, visibility, description, validation, and width modifiers. In CSS, scope rules with .gform-theme--framework (see the quick reference). Styling is driven by the CSS API variables (--gf-*). For legacy ul/li markup, see the original CSS guide.
Gravity Forms Orbital Theme
CSS API Variables (Common)
Override these on .gform-theme--framework to style Orbital forms. IDs use {form_id} and {field_id} (e.g. #gform_wrapper_1, #field_1_4).
| Variable | Scope | Purpose |
|---|---|---|
--gf-color-primary |
Wrapper | Primary color (buttons, links, focus) |
--gf-ctrl-bg-color |
Wrapper / field | Control background |
--gf-ctrl-border-color |
Wrapper / field | Control border color |
--gf-ctrl-radius |
Wrapper | Control border radius |
--gf-ctrl-label-color-primary |
Wrapper / field | Label color |
--gf-ctrl-desc-color |
Wrapper / field | Description text color |
--gf-form-gap-x, --gf-form-gap-y |
Wrapper / body | Gap between fields |
--gf-padding-x, --gf-padding-y |
Wrapper | Form padding |
--gf-ctrl-btn-bg-color-primary |
Wrapper / footer | Submit button background |
--gf-ctrl-choice-size |
Choice field | Radio/checkbox size |
Selector Quick Reference
| Target | Selector |
|---|---|
| All Orbital forms | .gform-theme--framework |
| Specific form | .gform-theme--framework#gform_wrapper_{form_id} |
| Form heading | .gform-theme--framework .gform_heading |
| Form body | .gform-theme--framework .gform-body (also .gform_body) |
| Field list | .gform-theme--framework .gform_fields (includes .top_label, .form_sublabel_*, .description_*, .validation_*) |
| Field by type | .gform-theme--framework .gfield--type-{type} |
| Multiple Choice alignment | .gfield--choice-align-vertical / .gfield--choice-align-horizontal |
| Specific field | .gform-theme--framework #field_{form_id}_{field_id} |
| Name First input | #input_{form_id}_{field_id}_3 or .name_first input |
| Name Last input | #input_{form_id}_{field_id}_6 or .name_last input |
| Address Street | #input_{form_id}_{field_id}_1 or .ginput_address_line_1 input |
| Address City | #input_{form_id}_{field_id}_3 or .ginput_address_city input |
| Address Zip | #input_{form_id}_{field_id}_5 or .ginput_address_zip input |
| Address Country | #input_{form_id}_{field_id}_6 or .ginput_address_country select |
| Form footer | .gform-theme--framework .gform-footer (also .gform_footer; label placement class e.g. .top_label) |
| Submit button | #gform_submit_button_{form_id} or .gform_button |