When a site is upgraded to use the new dynamic theme, its form's HTML must be updated so that the theme's CSS is applied.
Applying the following changes to the form's HTML:
- Replace the
<div>s used to wrap fields with<p>s. (optional) - This applies the margins assigned to
<p>elements to the form's wrappers, spacing them out. - Add the class form-field to all
<p>s. - Remove trailing forward slashes from all non closing html elements.
- E.g.
<img … />becomes<img … >and<input … />becomes<input … > - Remove
class="fields"andclass="buttons"from<fieldset>s. - Remove the mandatory class from all fields and for those that are not mandatory (you can look at the Twig validation to check) add
<em>Optional</em>to below the field element. - Add the class button to the form’s submit button.
Old HTML:
<div class="mandatory>
<label for="first_name">First name</label>
<input type="text" name="first_name" id="first_name" value="{{ … }}" />
</div>
New HTML:
<p class="form-field">
<label for="first_name">First name</label>
<input type="text" name="first_name" id="first_name" value="{{ … }}">
<em>Optional</em>
</p>