Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rude-pears-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudfour/patterns': patch
---

Add accessible names to comments
29 changes: 15 additions & 14 deletions src/components/comment/comment.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
<article
class="c-comment {{_comment_modifiers}}"
id="comment-{{comment.ID}}"
aria-labelledby="comment-heading-{{comment.ID}}"
>
<header class="c-comment__header">
{% block header_content %}
<h{{_heading_depth}} class="c-comment__heading">
{% block heading_content %}
{% block author_title %}
{{comment.author.name}}
{% endblock %}
<header class="c-comment__header">
{% block header_content %}
<h{{_heading_depth}} class="c-comment__heading" id="comment-heading-{{comment.ID}}">
{% block heading_content %}
{% block author_title %}
{{comment.author.name}}
{% endblock %}

<span class="u-hidden-visually">
{% if comment.is_child %}replied{% else %}said{% endif %}:
</span>
{% endblock %}
</h{{_heading_depth}}>
{% endblock %}
</header>
<span class="u-hidden-visually">
{% if comment.is_child %}replied{% else %}said{% endif %}:
</span>
{% endblock %}
</h{{_heading_depth}}>
{% endblock %}
</header>
<div class="c-comment__object">
{% include '@cloudfour/components/avatar/avatar.twig' with {
src: comment.avatar,
Expand Down