Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing screenreader only checkbox in Statistics Block #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion templates/components/streamfield/blocks/stat_block.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{% verbatim %}
{% include "components/streamfield/blocks/heading2_block.html" with large_spacing=True value=value.heading sr_only=value.sr_only_label %}
{% if value.sr_only_label %}
<h2 class="sr-only">{{value.heading}}</h2>
{% else %}
{% include "components/streamfield/blocks/heading2_block.html" with large_spacing=True value=value.heading %}
{% endif %}
Comment on lines +2 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we need the same in card_section_block.html for #44, would it be simpler to update heading2_block.html to add something like {% if sr_only %}sr-only{% endif %} in the <h2>'s class?

It seems to be what the code originally intended, as this template already passed sr_only=value.sr_only_label.


<div class="flex flex-col md:flex-row gap-20">
{% for statistic in value.statistics %}
Expand Down