Form fields have long been the odd ones out in block themes. You could set the colors, fonts and borders of headings, links and buttons in the Site Editor, but text fields and dropdowns looked however the browser or the block’s own CSS wanted them to, which left them completely unstyled some of the time and out of step with the theme almost all of the time.
Many of my block themes try to bridge the gap by loading CSS that includes basic styles for form fields, but that solution comes with its own challenges. For one thing, if you make changes to the default theme styles, the form fields can feel out of place. For another, if every block theme includes its own form styles and writes them all slightly differently, some of them will clash with plugins like Jetpack, WooCommerce and Gravity Forms.
WordPress took its first steps toward a better solution with 6.9, which quietly added form fields to theme.json. WordPress 7.2 finishes the job. It adds a Form Controls section to the Site Editor, a new element for labels, and states like focus and invalid input, so you can style a form from top to bottom without a single line of CSS.
In this tutorial, we’ll take a look at how to style form fields in the Site Editor and in theme.json, using Twenty Twenty-Five as an example, and a few things that can get in the way.
Styling form fields in the Site Editor
The new controls are a bit tucked away, next to the settings for individual blocks:
- Go to “Appearance” → “Editor” → “Styles”, and click “Blocks & Elements”.
- Scroll down to “Form Controls”, and select “Form input”, “Form select” or “Form button”.
- Make your changes, and click “Save”.

“Form input” covers text fields and text areas, and “Form select” covers dropdowns. Both have the same controls: font, font size and line height, text and background color, padding and margin, border, border radius and shadow. That’s enough to make the fields of most forms match the rest of your site.

By text fields, WordPress means the field types you type text into: text, email, url, password, search, number and tel, along with textarea. Checkboxes, radio buttons and date pickers aren’t included, since most of these properties don’t do much for them anyway.
“Form button” is a bit different. It’s the same button element WordPress has had since 6.1, now listed with the form controls. It styles every button on your site, not just the ones in forms, so the buttons in your Buttons blocks will change too. If you only want to change the form buttons, use the Additional CSS of the block that contains the form instead.
Styling form fields in theme.json
If you’re building a theme, or a child theme, you can set the same styles in theme.json. There, form fields are elements, like links and headings: textInput for text fields, select for dropdowns and label for labels. The label element is new in 7.2, and only available in theme.json for now.
theme.json can also do something the Site Editor can’t yet: style the states of a field. Text fields support :focus, :focus-visible, :required, :user-valid, :user-invalid and ::placeholder, and dropdowns support :hover, :focus, :focus-visible and :active.
Here’s a theme.json for a Twenty Twenty-Five child theme, with smaller labels, fields in the same font as the rest of the site, gray borders that turn black when the field has focus, and a red border for fields with invalid input:
{ "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 3, "styles": { "elements": { "label": { "typography": { "fontSize": "var:preset|font-size|small", "fontWeight": "500" } }, "textInput": { "color": { "background": "var:preset|color|base", "text": "var:preset|color|contrast" }, "typography": { "fontFamily": "inherit", "fontSize": "inherit" }, "border": { "color": "var:preset|color|accent-4", "radius": "0.25rem", "style": "solid", "width": "1px" }, "spacing": { "padding": { "top": "0.5rem", "right": "0.75rem", "bottom": "0.5rem", "left": "0.75rem" } }, ":focus": { "border": { "color": "var:preset|color|contrast" } }, "::placeholder": { "color": { "text": "var:preset|color|accent-4" } }, ":user-invalid": { "border": { "color": "#B3261E" } } }, "select": { "color": { "background": "var:preset|color|base", "text": "var:preset|color|contrast" }, "typography": { "fontFamily": "inherit", "fontSize": "inherit" }, "border": { "color": "var:preset|color|accent-4", "radius": "0.25rem", "style": "solid", "width": "1px" }, "spacing": { "padding": { "top": "0.5rem", "right": "0.75rem", "bottom": "0.5rem", "left": "0.75rem" } }, ":focus": { "border": { "color": "var:preset|color|contrast" } } } } }}

Form fields are stubborn about fonts. Unlike most elements, they don’t inherit the font of the text around them. Browsers give them their own instead, usually a system font, and a monospace font for text areas. Setting fontFamily and fontSize to inherit makes them use the same font as the rest of the page. The background color does the same job for dropdowns, which some browsers give a light gray background by default.
When you give a field a border, set the border style too, like "style": "solid" in the example. If you only set the color and width, the browser keeps its own built-in style for form field borders, which in most browsers is inset: a border that’s darker on the top and left sides, to make the field look like it’s pressed into the page.
Twenty Twenty-Five doesn’t have a red in its palette, so the invalid border uses a color value directly. :user-invalid is worth using over the older :invalid, since it only kicks in after someone has interacted with the field. With :invalid, an empty required field is marked as an error before the visitor has typed a single letter.
You can also style the fields inside a specific block, by adding the elements under that block in styles.blocks. This gives the input in the Search block a background color, without changing any other fields:
"styles": { "blocks": { "core/search": { "elements": { "textInput": { "color": { "background": "var:preset|color|accent-5" } } } } }}
Things to keep in mind
The form field styles apply to every form on the site, whether it comes from a block, a plugin or a theme. But they’re the most general styles there are, so anything more specific wins over them:
- Block styles come first. Twenty Twenty-Five styles the fields in its Search and Comments Form blocks itself, with a rounded search field and gray borders. If you change the border of “Form input”, those two keep their own. For the Search block, target the field in
theme.jsonlike in the example above. The comment form is more stubborn: Twenty Twenty-Five sets its border color with!important, so the only way to change it is with CSS that uses!importanttoo, in the Comments Form block’s Additional CSS. Other themes that style their forms in block styles can have the same issue. - Plugin forms often bring their own CSS. Most form plugins style their fields, and if their CSS is more specific than the form field styles, theirs is what you’ll see. That’s partly by design: the form field styles are kept deliberately weak, so they don’t fight with plugins that know their own forms best. That does mean that your changes in the Site Editor won’t have the immediate effect you might be hoping for – especially until plugins have had time to refactor their own styles. Forms are tricky.
- You can disable form plugin styles, but you probably shouldn’t. Plugins like Gravity Forms have a setting to turn their styles off, and Contact Form 7 lets you do it with a filter or a constant in
wp-config.php, but that can have side effects. The same stylesheet usually handles the layout of the form too, like fields placed side by side, error messages and date pickers, and those can fall apart without it. Tread carefully. - States are only in theme.json for now. “Form button” has a “States” menu in the Site Editor, but “Form input” and “Form select” don’t, and labels aren’t in the Site Editor at all. Hopefully they’ll follow in a later release.
WordPress 7.2 is still in development, and some of the finer details above might change before the planned release in early December. I’ll update the tutorial once it’s out.









