Skip to content

Commit

Permalink
[#2829] Restructured captcha for error-styling and accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Oct 22, 2024
1 parent 16de4dc commit a36f7c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
{% if form_object.captcha %}
<div class="form__control ">
<div class="captcha">
<label class="label captcha__label">
<p class="utrecht-paragraph">
{{ form_object.captcha.label }}<span class="label__label--required"> * </span>
</p>
<label class="label captcha__label">
<span class="captcha__check">
{{ form_object.captcha.field.question }}
<span class="captcha__input">{% field_as_widget form_object.captcha "input" form_id %}</span>
</span>
{% if form_object.captcha.errors %}
{% errors errors=form_object.captcha.errors %}
{% endif %}
</label>
<div class="captcha__check">
<div>
<span class="captcha__prompt">{{ form_object.captcha.field.question }}</span>
</div>
<span class="captcha__input">{% field_as_widget form_object.captcha "input" form_id %}</span>
</div>
{% if form_object.captcha.errors %}
{% errors errors=form_object.captcha.errors %}
{% endif %}
</div>
</div>
{% endif %}
Expand Down
10 changes: 2 additions & 8 deletions src/open_inwoner/scss/components/Captcha/Captcha.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@
flex-direction: column;
gap: var(--spacing-medium);

.__label {
display: flex;
}

&__check {
display: flex;
align-items: center;
font-weight: bold;
justify-content: start;
gap: var(--spacing-large);
}

&__prompt {
font-weight: bold;
margin-bottom: var(--spacing-medium);
}

&__input .input {
Expand Down

0 comments on commit a36f7c3

Please sign in to comment.