Component

Paragraph

Some extra's for paragraph components.

 

Better classes

The classes on paragraph has been changed to:

{%
  set classes = [
    'paragraph',
    'paragraph--' ~ paragraph.bundle|clean_class,
    view_mode ? 'paragraph--' ~ paragraph.bundle|clean_class ~ '--' ~ view_mode|clean_class,
  ]
%}

Which gives you the following classes:

.paragraph {}
.paragraph--cta {}
.cta--teaser {}

 

Extra functions

Create the possibility to have paragraph-type-specific preprocess functions.

So inside paragraph--cta.theme you could now have this function:

<?php

/**
 * Implements template_preprocess_hook().
 */
function compony_preprocess_paragraph__cta(&$variables, $hook) {
  // Do custom preprocessing here, 
  // only for CTA paragraphs. 
}

(Docs: Extending hooks yourself)

paragraph
Responsive
Accessible
HTML
7 downloads
horizontal beam No open issue

comments

No comments yet