Skip to content

Instantly share code, notes, and snippets.

@DanLaufer
Last active October 19, 2018 04:45
Show Gist options
  • Save DanLaufer/dac06be421ef07bbd342d1ce80b280e2 to your computer and use it in GitHub Desktop.
Save DanLaufer/dac06be421ef07bbd342d1ce80b280e2 to your computer and use it in GitHub Desktop.
Drupal 8 - Expand Paragraph Titles
/**
* implements hook_form_node_form_alter()
* @author Daniel Laufer
* Add validation to the XXX content type.
*/
function mymodule_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
// expand paragraph titles
$form['#attached']['library'][] = 'mytheme/expand_paragraph';
}
// theme/styles/expand_paragraph.css
.js .paragraph-type-top .paragraph-type-title {
grid-column: 1 / 4;
}
expand_paragraph:
version: 1.x
css:
theme:
styles/expand_paragraph.css: { weight: -1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment