Last active
October 19, 2018 04:45
-
-
Save DanLaufer/dac06be421ef07bbd342d1ce80b280e2 to your computer and use it in GitHub Desktop.
Drupal 8 - Expand Paragraph Titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// theme/styles/expand_paragraph.css | |
.js .paragraph-type-top .paragraph-type-title { | |
grid-column: 1 / 4; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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