Skip to content

Allow required fields to be highlighted instead of optional fields #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 12, 2024

Conversation

kbayliss
Copy link
Collaborator

@kbayliss kbayliss commented Jul 11, 2024

Addresses #68

Adds a new TBXFORMS_HIGHLIGHT_REQUIRED_FIELDS setting which will mark required fields with * instead of marking optional fields with (optional).

Also:

  • adds some missing tests
  • allows developers to more easily target the required/optional <span> elements with two new classes: .tbxforms-field_marker--required and .tbxforms-field_marker--optional, allowing each variant to be independently styled.

Example when TBXFORMS_HIGHLIGHT_REQUIRED_FIELDS=False or not set (default behaviour):

Highlight optional

Example when TBXFORMS_HIGHLIGHT_REQUIRED_FIELDS=True:

Highlight required

@kbayliss
Copy link
Collaborator Author

kbayliss commented Jul 11, 2024

@zerolab @siimonevans Hola both! Does this address your needs?

@kbayliss kbayliss self-assigned this Jul 12, 2024
@kbayliss kbayliss requested a review from zerolab July 12, 2024 08:02
Copy link
Member

@zerolab zerolab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One non-blocking suggestion. This would do the trick rather nicely

@kbayliss kbayliss merged commit 58bef72 into main Jul 12, 2024
6 checks passed
@kbayliss kbayliss deleted the feature/68-highlight-required-fields branch July 12, 2024 14:01
@kbayliss kbayliss mentioned this pull request Jul 12, 2024
4 tasks
@kbayliss kbayliss linked an issue Jul 12, 2024 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow changing the label markup
2 participants