Change record status: 
Project: 
Introduced in branch: 
11.3.x
Introduced in version: 
11.3.4
Description: 

The views-view-grid-responsive.html.twig template includes two additional style options (row_class_custom and col_class_custom) that enable custom CSS classes to be passed to the rows and columns (respectively).

{#
/**
 * @file
 * Default theme implementation for views to display rows in a responsive grid.
 *
 * Available variables:
 * - attributes: HTML attributes for the wrapping element.
 * - title: The title of this group of rows.
 * - view: The view object.
 * - rows: The rows contained in this view.
 * - options: The view plugin style options.
 *   - alignment: a string set to either 'horizontal' or 'vertical'.
 *   - columns: A number representing the max number of columns.
 *   - cell_min_width: A number representing the minimum width of the grid cell.
 *   - grid_gutter: A number representing the space between the grid cells.
 *   - row_class_custom: Additional row classes provided by the user.
 *   - col_class_custom: Additional column classes provided by the user.
 * - items: A list of grid items.
 *   - attributes: HTML attributes for each row or column.
 *   - content: A list of columns or rows. Each row or column contains:
 *     - attributes: HTML attributes for each row or column.
 *     - content: The row or column contents.
 *
 * @see template_preprocess_views_view_grid_responsive()
 *
 * @ingroup themeable
 */
#}

{{ attach_library('views/views.responsive-grid') }}

{%
  set classes = [
    'views-view-responsive-grid',
    'views-view-responsive-grid--' ~ options.alignment,
    options.row_class_custom,
  ]
%}

{%
  set column_classes = [
    'views-view-responsive-grid__item ',
    options.col_class_custom,
  ]
%}

{% set responsive_grid_styles = [
    '--views-responsive-grid--column-count:' ~ options.columns ~ ';',
    '--views-responsive-grid--cell-min-width:' ~ options.cell_min_width ~ 'px;',
    '--views-responsive-grid--layout-gap:' ~ options.grid_gutter ~ 'px;',
  ]
%}

{% if title %}
  <h3>{{ title }}</h3>
{% endif %}
<div{{ attributes.addClass(classes).setAttribute('style', responsive_grid_styles|join()) }}>
  {% for item in items %}
    <div{{ item.attributes.addClass(column_classes) }}>
      <div class="views-view-responsive-grid__item-inner">
        {{- item.content -}}
      </div>
    </div>
  {% endfor %}
</div>
Impacts: 
Site builders, administrators, editors
Themers
Site templates, recipes and distribution developers