Posts

Showing posts from March, 2017

Drupal 8 - Theme building tips.

To remove existing css from the theme. (eg : css from core) In THEME_NAME_info.yml stylesheets-remove : - core/modules/system/css/system.module.css - core/modules/views/css/views.module.css   Add some JS / CSS only for front-page :  First create a new library in your THEME_NAME_library.yml front-page-library: js: - js/bx-slider.js Then add that library to page through a pre-processor (THEME_NAME.theme) : <?php function THEME_NAME_preprocess_page ( & $variables ) { if ( $variables [ 'is_front' ]) { $variables [ '#attached' ][ 'library' ][] = 'THEME_NAME/front-page-library' ; } } The Home page should have the required ` bx-slider.js ` now. More tips  coming up...