Preview List component does not load styling for Preview Card

Summary

Preview List component reuses the Preview Card for responsive mode.

However, there is an issue in Preview List component since it does not load stylings for Preview Cards.

This issue was found during the implementation of Teaser List format for Display Formats module.

Steps to reproduce

  1. Create a view mode that re-uses the Preview List component.
  2. Display this view mode and put it on responsive mode
  3. Notice that the styles are not loaded

Possible fixes

The issue is located in the .html.twig file of preview-list. As you can see the html file loads the preview-card pattern. However it does not load the stylesheet of the pattern.

On Drupal 8, the stylesheets are loaded only after requested. In order to be solved, the stylesheet of Preview Card need to be added in the libraries declaration of Preview List. This is done in the .ui_patterns file of preview-list..

Related issues

Edited by Konstantinos Platis
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information