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

Conversation

vossisboss
Copy link
Contributor

This PR addresses issue #43.

I used the same conditional template logic as the one for #44 for updating the cards block.

If there is a cleaner or more accessible way to address this, I am definitely open to feedback.

Comment on lines +2 to +6
{% 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 %}
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants