Follow-up to #2489394: Refactor the Search module markup to be inline with our standards.

Problem/Motivation

The parent issue updated the search result markup (search-result.html.twig) in Classy to follow BEM standards:

+<h3{{ title_attributes.addClass('search-result__title') }}>
   <a href="{{ url }}">{{ title }}</a>
 </h3>
 {{ title_suffix }}
<div class="search-result__snippet-info">
   {% if snippet %}
    <p{{ content_attributes.addClass('search-result__snippet') }}>{{ snippet }}</p>
   {% endif %}
   {% if info %}
    <p class="search-result__info">{{ info }}</p>
   {% endif %}
 </div>

The class names were not great before, and even with the BEMmification could be improved and made less ambiguous.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it is a markup improvement.
Unfrozen changes Unfrozen because it only changes CSS and markup
Disruption Will affect any contributed themes deriving from Classy that include CSS for search result items and do not have their own template file. Should not affect anything else.

Proposed resolution

Discuss some alternative class names to replace/partially replace these:

search-result__snippet-info
search-result__snippet
search-result__info

Remaining tasks

Discuss
Patch
Patch review
Visual regression tests

User interface changes

n/a

API changes

n/a

Comments

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

damondt’s picture

The most succinct BEM guide I found is here. For those who are unfamiliar.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.