Skip to content

Commit

Permalink
Refactor(web-twig): Use VisuallyHidden component instead of className
Browse files Browse the repository at this point in the history
refs #DS-926
  • Loading branch information
literat committed Sep 8, 2023
1 parent ed302bc commit d19b59e
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
{{ _disabledAttr }}
>
{% if _labelRendered %}
<legend class="accessibility-hidden">
<VisuallyHidden elementType="legend">
{{- _labelRendered -}}
</legend>
</VisuallyHidden>
{% if not _isLabelHidden %}
<div {{ classProp(_labelClassNames) }} aria-hidden="true">
{{- _labelRendered -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{% if _onEdit %}
<span class="FileUploaderAttachment__slot">
<button type="button" class="FileUploaderAttachment__action" onclick="{{ _onEdit }}">
<span class="accessibility-hidden">{{ _editText }}</span>
<VisuallyHidden>{{ _editText }}</VisuallyHidden>
<Icon name="edit" isReusable={ false } />
</button>
</span>
Expand All @@ -55,7 +55,7 @@
class="{{ _removeClassName }}"
data-spirit-populate-field="button"
>
<span class="accessibility-hidden">{{ _removeText }}</span>
<VisuallyHidden>{{ _removeText }}</VisuallyHidden>
<Icon name="close" isReusable={ false } />
</button>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
aria-expanded="false"
>
<Icon name="close" />
<span class="accessibility-hidden">{{ _label }}</span>
<VisuallyHidden>{{ _label }}</VisuallyHidden>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
isSquare
>
<Icon name="hamburger" />
<span class="accessibility-hidden">{{ _menuToggleLabel }}</span>
<VisuallyHidden>{{ _menuToggleLabel }}</VisuallyHidden>
</Button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
isSquare
>
<Icon name="close" />
<span class="accessibility-hidden">{{ _closeLabel }}</span>
<VisuallyHidden>{{ _closeLabel }}</VisuallyHidden>
</Button>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
{{ _targetAttr }}
{{ _typeAttr | raw }}
>
<span class="accessibility-hidden">{{ _accessibilityLabel }}</span>
<VisuallyHidden>{{ _accessibilityLabel }}</VisuallyHidden>
<span aria-hidden="true">{{ _pageNumber }}</span>
</{{ _elementType }}>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
}) } %}
{% block content %}
<Icon name="chevron-right" />
<span class="accessibility-hidden">{{ _accessibilityLabel }}</span>
<VisuallyHidden>{{ _accessibilityLabel }}</VisuallyHidden>
{% endblock %}
{% endembed %}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
}) } %}
{% block content %}
<Icon name="chevron-left" />
<span class="accessibility-hidden">{{ _accessibilityLabel }}</span>
<VisuallyHidden>{{ _accessibilityLabel }}</VisuallyHidden>
{% endblock %}
{% endembed %}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
aria-expanded="true"
>
<Icon name="close" aria-hidden="true" />
<span class="accessibility-hidden">{{ _closeLabel }}</span>
<VisuallyHidden>{{ _closeLabel }}</VisuallyHidden>
</button>
{% endif %}
<span class="{{ _arrowClassName }}"></span>
Expand Down

0 comments on commit d19b59e

Please sign in to comment.