Skip to content

Commit 4360ebd

Browse files
committed
♿ [#1604] Fixed aria-labels, contrast, label-nesting for survey and file-input
1 parent be1d704 commit 4360ebd

File tree

10 files changed

+44
-30
lines changed

10 files changed

+44
-30
lines changed

src/open_inwoner/accounts/templates/django_registration/registration_form.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
{% if digit_url %}
99
{% render_column start=5 span=5 %}
1010
{% render_card direction='horizontal' tinted=True %}
11-
<a href="{% url 'digid:login' %}" class="link digid-logo" aria-describedby="Digid logo" title="Digid logo">
12-
<img class="digid-logo__image" src="{% static 'accounts/digid_logo.svg' %}" alt="Digid logo">
11+
<a href="{% url 'digid:login' %}" class="link digid-logo">
12+
<img class="digid-logo__image" src="{% static 'accounts/digid_logo.svg' %}" alt="{% trans "DigiD inlogpagina" %}">
1313
</a>
1414
{% link bold=True href=digit_url text=_('Registreren met DigiD') secondary=True icon='arrow_forward' %}
1515
{% endrender_card %}

src/open_inwoner/accounts/templates/registration/login.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ <h1 class="h1">{% trans 'Welkom' %}</h1>
1717
<br>
1818
{% if settings.DIGID_ENABLED %}
1919
{% render_card direction='horizontal' tinted=True %}
20-
<a href="{% url 'digid:login' %}" class="link digid-logo" aria-describedby="Digid logo" title="Digid logo">
21-
<img class="digid-logo__image" src="{% static 'accounts/digid_logo.svg' %}" alt="Digid logo">
20+
<a href="{% url 'digid:login' %}" class="link digid-logo">
21+
<img class="digid-logo__image" src="{% static 'accounts/digid_logo.svg' %}" alt="{% trans "DigiD inlogpagina" %}">
2222
</a>
2323
{% url 'digid:login' as href %}
2424
{% with href|addnexturl:next as href_with_next %}
@@ -32,7 +32,7 @@ <h1 class="h1">{% trans 'Welkom' %}</h1>
3232
{% if oidc_config.enabled and site_config.openid_enabled_for_regular_users %}
3333
{% render_card tinted=True direction='horizontal' %}
3434
{% if site_config.openid_connect_logo %}
35-
<a href="{% url 'oidc_authentication_init' %}" class="link digid-logo" aria-describedby="{{ site_config.openid_connect_logo.default_alt_text }}" title="{{ site_config.openid_connect_logo.default_alt_text }}">
35+
<a href="{% url 'oidc_authentication_init' %}" class="link digid-logo">
3636
<img class="digid-logo__image" src="{{ site_config.openid_connect_logo.url }}" alt="{{ site_config.openid_connect_logo.default_alt_text }}">
3737
</a>
3838
{% else %}

src/open_inwoner/components/templates/components/Dropdown/Dropdown.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load i18n button_tags %}
22

33
<div class="dropdown">
4-
{% button href="#" icon=icon|default:'expand_more' text_icon=text_icon icon_position='after' class=class bordered=False text=text icon_outlined=True transparent=True single=True disabled=disabled secondary=secondary size="small" %}
4+
{% button href="#" icon=icon|default:'expand_more' text_icon=text_icon icon_position='after' class=class bordered=False text=text title=_("Keuzemenu") icon_outlined=True transparent=True single=True disabled=disabled secondary=secondary size="small" %}
55
<div class="dropdown__content">
66
{{ contents }}
77
</div>

src/open_inwoner/components/templates/components/Form/FileInput.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<span class="input-file">
77
{{ field|addclass:"inputfile" }}
88

9-
<label class="label__label" for="{{ field.auto_id }}">
10-
{% icon icon="cloud_upload" icon_position="before" outlined=True %}
11-
{{ text }}
9+
<span class="label__label" for="{{ field.auto_id }}">
10+
{% icon icon="cloud_upload" icon_position="before" outlined=True %}
11+
{{ text }}
1212

13-
</label>{% if field.field.required %}<span class="label__label--required"> * </span>{% endif %}
13+
</span>{% if field.field.required %}<span class="label__label--required"> * </span>{% endif %}
1414
</span>
1515

1616
{% if field.errors %}

src/open_inwoner/components/templates/components/Header/AccessibilityHeader.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load i18n link_tags %}
22

3-
<div class="accessibility-header">
4-
<ul class="accessibility-header__list" role="complementary" aria-label="{% trans "Toegankelijkheidshulp" %}">
3+
<div class="accessibility-header" role="complementary">
4+
<ul class="accessibility-header__list" aria-label="{% trans "Toegankelijkheidshulp" %}">
55
<li class="accessibility-header__list-item">
66
{% trans "Doorgaan naar hoofdinhoud" as link_text %}
77
{% link href="#content" icon="south" text=link_text extra_classes="skip-link" %}

src/open_inwoner/scss/components/Card/Card.scss

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161

6262
&--tinted {
6363
--card-color-background: var(--color-gray-lightest);
64+
65+
// contrast for accessibility
66+
.form .caption__content {
67+
color: var(--color-tinted-mute);
68+
}
6469
}
6570

6671
&__img {

src/open_inwoner/scss/components/Form/DocumentUpload.scss

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#document-upload {
22
gap: var(--spacing-tiny);
3+
max-width: var(--mobile-xs-width);
34

45
.button[type='submit']:disabled {
56
background-color: var(--color-gray) !important;
@@ -17,10 +18,6 @@
1718
}
1819
}
1920

20-
input[type='text'] {
21-
max-width: var(--mobile-xs-width);
22-
}
23-
2421
.inputfile-group {
2522
display: block;
2623

@@ -48,10 +45,11 @@
4845
/// File-input site wide
4946
input[type='file'] {
5047
background-color: var(--color-white);
51-
color: var(--color-primary-lighter);
48+
color: var(--color-primary);
5249
border: 1px solid var(--color-mute);
5350
border-radius: var(--border-radius);
5451
display: inline-block;
52+
filter: saturate(70%);
5553
min-width: 100%;
5654
max-width: var(--form-width);
5755
padding: 0;
@@ -129,7 +127,8 @@ input[type='file']::file-selector-button {
129127
z-index: 200;
130128
}
131129

132-
.inputfile + label {
130+
.inputfile + .label,
131+
.inputfile + .label__label {
133132
display: inline-block;
134133
position: absolute;
135134
top: 5px;
@@ -145,28 +144,36 @@ input[type='file']::file-selector-button {
145144
z-index: -1;
146145
}
147146

148-
.inputfile:focus + label,
149-
.inputfile.has-focus + label,
150-
.inputfile:hover + label,
151-
.inputfile + label:hover {
147+
.inputfile:focus + .label__label,
148+
.inputfile.has-focus + .label__label,
149+
.inputfile:hover + .label__label,
150+
.inputfile + .label__label:hover,
151+
.inputfile:focus + .label,
152+
.inputfile.has-focus + .label,
153+
.inputfile:hover + .label,
154+
.inputfile + .label:hover {
152155
background-color: var(--color-primary-darker);
153156
top: 4px;
154157
transition: all 0.3s, background-color 0.3s;
155158
}
156159

157-
.inputfile + label *[class*='icons'] {
160+
.inputfile + .label__label *[class*='icons'],
161+
.inputfile + .label *[class*='icons'] {
158162
width: 1.3em;
159163
vertical-align: middle;
160164
color: white;
161165
margin-left: var(--spacing-medium);
162166
}
163167

164-
.inputfile + label {
168+
.inputfile + .label__label {
165169
cursor: pointer; /* "hand" cursor */
166170
}
167171

168-
.inputfile:focus + label {
169-
outline: 2px solid orange;
172+
.inputfile:focus + .label,
173+
.inputfile:focus-visible + .label,
174+
.inputfile:focus + .label__label,
175+
.inputfile:focus-visible + .label__label {
176+
outline: var(--border-width) solid var(--color-secondary);
170177
outline: -webkit-focus-ring-color auto 5px;
171178
}
172179
}
@@ -198,7 +205,6 @@ input[type='file']::file-selector-button {
198205
justify-content: space-around;
199206
border: 1px solid lightgray;
200207
border-radius: 4px;
201-
max-width: var(--mobile-xs-width);
202208
height: 80px;
203209
padding-top: var(--spacing-large);
204210
margin-bottom: 20px;

src/open_inwoner/scss/components/Notification/_Notification.scss

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
position: absolute;
5858
top: var(--spacing-small);
5959
right: var(--spacing-small);
60+
color: var(--color-black);
6061
cursor: pointer;
6162
}
6263

src/open_inwoner/scss/views/App.scss

+2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@
179179
--color-body: var(--color-gray-dark);
180180
// changed to #949494 to get the required 3:1 contrast ratio - in case of decorative border use var(--color-gray).
181181
--color-mute: #949494;
182+
// text-color for muted text inside tinted cards
183+
--color-tinted-mute: #696969;
182184

183185
/// Font.
184186

src/open_inwoner/templates/pages/search.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ <h3 class="search-results__item-title">{{ hit.name }}</h3>
6060
<div class="grid">
6161
<aside class="feedback" aria-label="{% trans "Pagina feedback" %}">
6262
<h4 class="h4">{% trans "Feedback" %}</h4>
63-
<p class="p">{% trans "Heeft u gevonden wat u zocht?" %}</p>
63+
<p class="p" id="feedback__survey">{% trans "Heeft u gevonden wat u zocht?" %}</p>
6464
{% render_form form=feedback_form method="POST" form_action=request.get_full_path id="feedback_form" show_notifications=True %}
6565
{% csrf_token %}
6666
{{ feedback_form.errors }}
6767
<div class="feedback__options">
6868
{% spaceless %}
6969
<label class="button-radio" for="positive">
7070
<input class="button-radio__input" type="radio" name="positive" id="positive" value="true" aria-label="{{ _('Ik heb gevonden wat ik zocht.') }}"/>
71-
<label class="button-radio__button" for="positive">{% icon icon="thumb_up" outlined=True %}</label>
71+
<span class="button-radio__button">{% icon icon="thumb_up" outlined=True %}</span>
7272
</label>
7373
<label class="button-radio" for="negative">
7474
<input class="button-radio__input" type="radio" name="positive" id="negative" value="false" aria-label="{{ _('Ik heb niet gevonden wat ik zocht.') }}" />
75-
<label class="button-radio__button" for="negative">{% icon icon="thumb_down" outlined=True %}</label>
75+
<span class="button-radio__button">{% icon icon="thumb_down" outlined=True %}</span>
7676
</label>
7777
{% endspaceless %}
7878
</div>

0 commit comments

Comments
 (0)