I think more 'if tests' may be added to radix:navbar-brand component to avoid empty span or div outputs.

Before :

      {% block logo %}
       ...

        <div class="navbar-brand__text d-flex flex-column">
          <span>{{ text }}</span>
        
          {% if site_slogan %}
            <span class="small text-muted">{{ site_slogan }}</span>
          {% endif %}
        </div>
      {% endblock %}

After:

      {% block logo %}
       ...

        {% if text or site_slogan %}          <--- avoids empty div if both are not set
          <div class="navbar-brand__text d-flex flex-column">
            {% if text %}                            <--- avoids empty span if not set
              <span>{{ text }}</span>
            {% endif %}

            {% if site_slogan %}
              <span class="small text-muted">{{ site_slogan }}</span>
            {% endif %}
          </div>
        {% endif %}
      {% endblock %}

Issue fork radix-3421326

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

PhilY created an issue. See original summary.

doxigo’s picture

Great catch Philippe, would you mind to open a PR? thanks

  • doxigo committed 41ec313a on 6.0.x authored by PhilY
    Issue #3421326: radix:navbar-brand component may output empty span/div
    
doxigo’s picture

Status: Active » Fixed

Great work, merged, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.