Note: Unix-like systems only.
- Export your extensions to a shell file:
code --list-extensions | sed -e 's/^/code --install-extension /' > my_vscode_extensions.sh
in module.libraries.yml
:
module-css:
css:
theme:
css/style.css: { weight: 100 }
- Alignment In Flexbox: Auto margins (cheatsheet)
- A Complete Guide to Flexbox (css-tricks.com)
- Drupal 8 Entity API cheat sheet by Metal Toad
- Drupal 8 Entity Cheat Sheet.pdf by wizzlern
- The Drupal 8 configuration schema cheat sheet by Gabor Hojtsy
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_css_alter(). | |
*/ | |
function THEME_css_alter(&$css) { | |
// Use <link> as opposed to <style> @import during development if | |
// css preprocessing is turned off. This will allow tools like | |
// BrowserSync and LiveReload to work properly. | |
$preprocess_css = \Drupal::config('system.performance')->get('css.preprocess'); | |
if (isset($preprocess_css) && $preprocess_css === FALSE) { | |
foreach ($css as $key => $value) { |
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_theme_suggestions_HOOK_alter(); | |
*/ | |
function THEME_theme_suggestions_page_alter(array &$suggestions, array $variables) { | |
if ($node = \Drupal::routeMatch()->getParameter('node')) { | |
if (!is_object($node)) { | |
$node = \Drupal\node\Entity\Node::load($node); | |
} | |
$bundle = $node->bundle(); | |
$suggestions[] = $variables['theme_hook_original'] . '__node__' . $bundle; |
Simplified Twig template variables for Drupal
The Bamboo Twig module provides some Twig extensions with some useful functions and filters aimed to improve the development experience.