function paragraphs_demo_preprocess_node

Implements hook_preprocess_node() for paragraph node templates.

Attach css we need for paragraph demo content.

File

paragraphs/modules/paragraphs_demo/paragraphs_demo.module, line 36
Contains paragraphs_demo.module

Code

function paragraphs_demo_preprocess_node(&$variables) {

  // If more general approach is needed then implement preprocessor for
  // paragraph.html.twig.
  if ($variables['node']
    ->getType() === 'paragraphed_content_demo') {
    $variables['#attached']['library'][] = 'paragraphs_demo/drupal.paragraphs_demo';
  }
}