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
  • Loading branch information
literat committed Sep 7, 2023
1 parent 373542b commit afa762b
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Menu
</Button>
<Button color={color} size={size} isSquare>
<span class="accessibility-hidden">Menu</span>
<VisuallyHidden>Menu</VisuallyHidden>
<Icon name="hamburger" />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Menu
</Button>
<Button color={color} size={size} isSquare isDisabled>
<span class="accessibility-hidden">Menu</span>
<VisuallyHidden>Menu</VisuallyHidden>
<Icon name="hamburger" />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div>
<ButtonLink color={color} size={size} href="#">Button {{ color }}</ButtonLink>
<ButtonLink color={color} size={size} href="#" isSquare>
<span class="accessibility-hidden">Menu</span>
<VisuallyHidden>Menu</VisuallyHidden>
<Icon name="link" />
</ButtonLink>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div>
<ButtonLink color={color} size={size} isDisabled href="#">Disabled {{ color }}</ButtonLink>
<ButtonLink color={color} size={size} href="#" isSquare isDisabled>
<span class="accessibility-hidden">Menu</span>
<VisuallyHidden>Menu</VisuallyHidden>
<Icon name="link" />
</ButtonLink>
</div>
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 afa762b

Please sign in to comment.