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
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
Comment #2
damondt commentedThe most succinct BEM guide I found is here. For those who are unfamiliar.
Comment #17
gauravvvv commentedComment #18
smustgrave commentedFirst item in the tasks is to discuss but don't see that. This could have some BC concerns that need to be considered.
Comment #19
saurav-drupal-dev commentedHi @smustgrave
for the discussion please share ur thought what approach we should be considering?
Comment #20
nayana_mvr commentedAs per comment in the parent ticket https://www.drupal.org/project/drupal/issues/2489394#comment-9956761
So, do we need to change all the three class names or can we just change
.search-result__snippet-infoto something which doesn't contain the wordsinfoorsnippet. I think.search-result__contentused in the MR is a good example or else please suggest new class names.After the current MR changes, this is how it looks like:-
Adding reference link given in the parent ticket:- https://www.drupal.org/coding-standards/css/architecture
Comment #22
quietone commentedThe Search Module was approved for removal in #3476883: [Policy, no patch] Move Search module to contrib .
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3565780: [meta] Tasks to deprecate the Search module and the removal work in #3565783: [meta] Tasks to remove the Search module.
Search will be moved to a contributed project before Drupal 12.0.0 is released.