0

Updating old form's HTML to target the new default Theme's CSS

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:

  1. Replace the <div>s used to wrap fields with <p>s. (optional)
    1. This applies the margins assigned to <p> elements to the form's wrappers, spacing them out.
  2. Add the class form-field to all <p>s.
  3. Remove trailing forward slashes from all non closing html elements.
    1. E.g. <img … /> becomes <img … > and <input … /> becomes <input … >
  4. Remove class="fields" and class="buttons" from <fieldset>s.
  5. 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.
  6. 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>

0 comments

Please sign in to leave a comment.