Skip to content

v2.1.0

Choose a tag to compare

@kylebayler kylebayler released this 15 Jul 14:20
· 18 commits to main since this release

What's changed

Changed

  • Allow required fields to be highlighted instead of optional ones [#78]
  • Allow markup in error messages [#79]

Full Changelog: v2.0.1...v2.1.0

Upgrade considerations

Highlight required fields instead of optional ones

You can now invert the default behaviour and append asterisks to required fields instead of appending "(optional)" to optional fields.

If TBXFORMS_HIGHLIGHT_REQUIRED_FIELDS=False (or unset), optional fields will
have "(optional)" appended to their labels. This is the default behaviour and
recommended by GDS.

If TBXFORMS_HIGHLIGHT_REQUIRED_FIELDS=True, required fields will have an
asterisk appended to their labels and optional fields will not be highlighted.

You can also style these markers by targeting these CSS classes:

  • .tbxforms-field_marker--required
  • .tbxforms-field_marker--optional