This document discusses creating a Drupal 8 theme using Node.js, LibSass, Gulp, and BrowserSync. It outlines installing Node.js and necessary modules like Gulp and Gulp-Sass. The Gulpfile configures tasks for Sass compilation, JavaScript, images, Twig, and BrowserSync. BrowserSync helps test the site on multiple devices. The theme structure and adding CSS/JS assets to Drupal 8 are also covered, along with debugging tools. Source code for an example theme is provided, and contact info is given to ask questions.
1 of 13
Downloaded 12 times
More Related Content
Creating a drupal 8 theme with node.js, libsass, gulp & browsersync
9. BROWSERSYNC
BrowserSync is similar to Livereload, however it helps
you test your site on multiple devices over a shared
network by synchronising URLs, interactions and code
changes across multiple devices. Its wicked-fast and
totally free.
10. ADDING JS AND CSS ASSETS TO A
DRUPAL 8 THEME
Deleting or overriding existing styles served by core
Declaring dependencies
Specifying scope of a JS (footer)
Specifying media type
Conditional CSS or JS for older IE browsers
Bringing in an external JS or CSS resource
Adding or limiting a library to specific pages
11. DEBUGGING TOOLS IN D8
Get template file name suggestions by enabling debug.
In D8 set "debug: true" in sites/default/services.yml
while developing
In D7 (7.33) add $conf['theme_debug'] = TRUE;
to settings.php
#12: Template will be surrounded by HTML comments.
Twig templates are automatically recompiled whenever the source code changes (see auto_reload below).
Check out core for structure and examples