ITC Forms 0.15.6Changelog
Form design tokens
The Form block inherits Global Styles by default. Its container uses WordPress
color, typography, spacing and border block supports, and its submit control is
a wp-element-button. Themes should use theme.json presets and element styles
first. settings.custom.itcForms is the stable bridge for form-specific details
that WordPress does not currently model, such as native-control radii.
Stable map
Section titled “Stable map”WordPress converts each settings.custom path below into the middle custom
property. ITC Forms aliases it on the block wrapper to the semantic property in
the final column only when that setting exists. The aliases are stable public
CSS integration points.
settings.custom.itcForms path |
WordPress property | ITC Forms property |
|---|---|---|
maxWidth |
--wp--custom--itc-forms--max-width |
--itc-form-max-width |
fontFamily |
--wp--custom--itc-forms--font-family |
--itc-form-font-family |
fontSize |
--wp--custom--itc-forms--font-size |
--itc-form-font-size |
lineHeight |
--wp--custom--itc-forms--line-height |
--itc-form-line-height |
textColor |
--wp--custom--itc-forms--text-color |
--itc-form-text-color |
fieldGap |
--wp--custom--itc-forms--field-gap |
--itc-form-field-gap |
labelGap |
--wp--custom--itc-forms--label-gap |
--itc-form-label-gap |
control.background |
--wp--custom--itc-forms--control--background |
--itc-form-control-background |
control.text |
--wp--custom--itc-forms--control--text |
--itc-form-control-text |
control.borderColor |
--wp--custom--itc-forms--control--border-color |
--itc-form-control-border |
control.borderWidth |
--wp--custom--itc-forms--control--border-width |
--itc-form-control-border-width |
control.borderStyle |
--wp--custom--itc-forms--control--border-style |
--itc-form-control-border-style |
control.radius |
--wp--custom--itc-forms--control--radius |
--itc-form-control-radius |
control.padding |
--wp--custom--itc-forms--control--padding |
--itc-form-control-padding |
control.minHeight |
--wp--custom--itc-forms--control--min-height |
--itc-form-control-min-height |
button.background |
--wp--custom--itc-forms--button--background |
--itc-form-button-background |
button.text |
--wp--custom--itc-forms--button--text |
--itc-form-button-text |
button.radius |
--wp--custom--itc-forms--button--radius |
--itc-form-button-radius |
focusColor |
--wp--custom--itc-forms--focus-color |
--itc-form-focus-color |
error.text, error.background, error.border |
matching --wp--custom--itc-forms--error--* properties |
matching --itc-form-error-* properties |
success.text, success.background, success.border |
matching --wp--custom--itc-forms--success--* properties |
matching --itc-form-success-* properties |
Keep error and success values as contrast-safe sets. ITC Forms retains its
accessible neutral fallbacks when these paths are absent. A classic theme with
no theme.json also retains usable controls, buttons, errors and focus.
Theme example
Section titled “Theme example”Reference presets instead of copying their resolved values:
{ "version": 3, "settings": { "custom": { "itcForms": { "fieldGap": "var:preset|spacing|40", "control": { "background": "var:preset|color|base", "text": "var:preset|color|contrast", "borderColor": "var:preset|color|contrast", "radius": "0.5rem", "padding": "var:preset|spacing|30" }, "button": { "background": "var:preset|color|accent", "text": "var:preset|color|base", "radius": "0.5rem" }, "focusColor": "var:preset|color|accent" } } }}The block’s Appearance panel has three modes:
- Inherit theme is the default and follows theme changes automatically.
- Theme presets stores palette or spacing slugs and renders them through
--wp--preset--*variables. A classic theme without presets falls back to inheritance. - Custom overrides stores only the few control/button colors, gaps and radii changed on that block. The server accepts hex colors and bounded CSS dimensions and ignores invalid values.
The normal WordPress Styles controls remain available for the block container in every mode.
Extension pair
Section titled “Extension pair”PHP is authoritative on the frontend. This example changes one semantic value without receiving a definition, submission, destination or secret:
add_filter( 'itc_forms_block_theme_tokens', function ( array $tokens, array $attributes, string $mode ): array { if ( $mode === 'inherit' ) { $tokens['buttonRadius'] = '0.25rem'; } return $tokens; }, 10, 3);Pair it with the editor-only preview filter when visual parity requires it:
wp.hooks.addFilter( 'itcForms.block.themeTokens', 'acme/forms-theme', ( tokens, mode ) => mode === 'inherit' ? { ...tokens, buttonRadius: '0.25rem' } : tokens);Both filters accept only documented keys and safe values. JavaScript cannot alter frontend rendering, validation, submission behavior, or server data.
Headless / no-default-styles mode
Section titled “Headless / no-default-styles mode”Developers who own the complete presentation layer can prevent the frontend
stylesheet from loading. The form keeps its semantic HTML, stable
itc-form__* classes and data-itc-* attributes, conditional logic, client
validation, and server behavior.
add_filter( 'itc_forms_enqueue_frontend_styles', '__return_false' );This switch is site-wide because WordPress block styles are registered per
block type, not safely removable for one instance after rendering begins. A
theme using this mode must style controls, [hidden], focus indicators,
required and invalid states, error summaries, success messages, the honeypot,
and challenge-provider UI. Do not dequeue the view script: it supplies
conditional logic, validation, focus management, and CAPTCHA lifecycle code.