Problem/Motivation

The css/base/elements.css file contains the following comment.

/**
 * Unfortunately, text-decoration for details summary is not supported on all
 * browsers. So we add a span (which can handle text-decoration) in Seven's
 * templates/details.html.twig. In case there are other details templates that
 * don't have the span, we provide text-decoration in the parent selector.
 * This provides maximum compatibility and coverage with minimal disruption.
 */

It is no longer true that a <span> is added in the templates/details.html.twig file. In fact, the currently used markup is the following one.

<details{{ attributes.addClass('seven-details') }}>
  {%- if title -%}
    {%
      set summary_classes = [
        'seven-details__summary',
        required ? 'js-form-required',
        required ? 'form-required',
      ]
    %}
    <summary{{ summary_attributes.addClass(summary_classes) }}>
      {{- title -}}
    </summary>
  {%- endif -%}
  <div class="seven-details__wrapper details-wrapper">
    {% if errors %}
      <div class="form-item form-item--error-message">
        <strong>{{ errors }}</strong>
      </div>
    {% endif %}
    {%- if description -%}
      <div class="seven-details__description">{{ description }}</div>
    {%- endif -%}
    {%- if children -%}
      {{ children }}
    {%- endif -%}
    {%- if value -%}
      {{ value }}
    {%- endif -%}
  </div>
</details>

The content of the <summary> tag is the following one.

    <summary{{ summary_attributes.addClass(summary_classes) }}>
      {{- title -}}
    </summary>

Proposed resolution

Remove the following lines from the css/base/elements.css file.

/**
 * Unfortunately, text-decoration for details summary is not supported on all
 * browsers. So we add a span (which can handle text-decoration) in Seven's
 * templates/details.html.twig. In case there are other details templates that
 * don't have the span, we provide text-decoration in the parent selector.
 * This provides maximum compatibility and coverage with minimal disruption.
 */
details summary:focus span,
details summary:hover span {
  text-decoration: underline;
}

Issue fork seven-3546623

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

avpaderno created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

avpaderno’s picture

Status: Active » Needs review
avpaderno’s picture

I checked on the live preview; on the /admin/modules page, for example, the Displays announcements from the Drupal community. text is still shown underlined when it is hovered or when it is the selected item.

Are there other pages to check?

  • avpaderno committed 8fccc399 on 2.0.x
    Issue #3546623: Remove the styles for "details summary:focus span"
    
avpaderno’s picture

Version: 2.0.x-dev » 1.0.x-dev

  • avpaderno committed dbbc794e on 1.0.x
    Issue #3546623: Remove the styles for "details summary:focus span"
    
avpaderno’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

avpaderno’s picture

Status: Fixed » Closed (fixed)

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