Skip to content

Conversation

vengador
Copy link
Collaborator

No description provided.

Copy link

🚀 Deployed on https://preview-684--oelibrary.netlify.app

@github-actions github-actions bot temporarily deployed to pull request July 14, 2025 12:38 Inactive
@@ -31,6 +31,7 @@
{% set _with_backdrop = with_backdrop ?? true %}
{% set _with_close = with_close ?? true %}
{% set _close_aria_label = close_aria_label|default('') %}
{% set _close_content = '' %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a comment about code structure, we can put all parameters that can be set at the top and then variables used by the template.

Another option is to add the parameter, but then the pattern should add it too.

So I'd set by default this after line 77 or so:

{% set _close_content %}
        <span class="label visually-hidden">Close</span>
 {% endset %}

Comment on lines +103 to +105
{% if _close_aria_label %}
{% set _close_attributes = _close_attributes.setAttribute('aria-label', _close_aria_label) %}
{% else %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

And here we avoid the else:

Suggested change
{% if _close_aria_label %}
{% set _close_attributes = _close_attributes.setAttribute('aria-label', _close_aria_label) %}
{% else %}
{% if _close_aria_label %}
{% set _close_attributes = _close_attributes.setAttribute('aria-label', _close_aria_label) %}
{% set _close_content = '' %}
{% endif %}

{% set _close_attributes = _close_attributes.setAttribute('aria-label', _close_aria_label) %}
{% else %}
{% set _close_content %}
<span class="label visually-hidden">{{ "Close" }}</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we can add the translation filter here and if we should, this texts may not get translated.

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