Skip to content

Styling and overrides ​

Most styling needs no code: each form's theme, accent colour and colour scheme are set in its Appearance section. See Themes and styling. This page is for the rest.

CSS for one form ​

A form's Custom CSS section holds CSS for that form only. Start each rule with the selector the section shows, such as .nxforms-form[data-form-id="12"], because the CSS is added to the whole page. Only Super Users can change it. The same section sets a Form wrapper class for the form's outer element.

Classes for fields ​

In a field's settings, Advanced has CSS class(es): space-separated class names added to the field's wrapper, for example hero-field is-wide.

The main classes ​

NXForms' own classes start with nxforms-. These are the ones you'll most often target:

ClassElement
.nxforms-formThe form's outer element, with data-form-id
.nxforms-form__formThe <form> element
.nxforms-form__groupEach field's wrapper; --half and --third mark fields in columns
.nxforms-form__labelA field's label
.nxforms-form__input, .nxforms-form__select, .nxforms-form__textareaThe inputs
.nxforms-form__errorA field's error message
.nxforms-form__buttonThe form's buttons
.nxforms-form__messagesThe success or error message after sending
.nxforms-form__step-indicator, .nxforms-form__progressThe steps and progress bar of a multi-step form
.nxforms-form-modalA form in a popup

Prefer these classes over the HTML structure around them, which can change between versions.

The form's outer element also says which theme and colour scheme it uses, in data-nxforms-theme (classic, clean, underline or floating) and data-nxforms-scheme (light, dark or auto). The accent colour is the CSS variable --nxff-accent, and a popup's width is --nxff-modal-width:

css
.nxforms-form[data-form-id="12"] {
  --nxff-accent: #0f766e;
}

Template overrides ​

NXForms builds each form's HTML itself, not from Joomla template files, so a template override can't change its fields, labels or buttons: style those with CSS, as above.

The form page template (com_nxforms/form/default.php) prints the menu item's page heading and the finished form inside <div class="com-nxforms-form">, with the menu item's Page Class. The module template (mod_nxforms/default.php) prints only the finished form. Overriding them lets you add your own markup around the form, the same for every form shown that way.

For a heading, a browser title or a page class, you don't need an override: use the Single Form menu item's Page Display options. See Menu items, modules, articles and popups.

After moving from NXP Easy Forms ​

The import copies custom CSS, wrapper classes and field classes as they were; it doesn't rewrite them. Selectors that use NXP Easy Forms' old class names no longer match: the import's checklist lists the forms to review. Replace the old names with the nxforms- classes above. See Moving from NXP Easy Forms.

For developers ​

Plugins can react to and change what NXForms does, from rendering to sending: see Developer hooks.