-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Drupal 8 Development Cookbook - Second Edition
By :
The asset management system is the most recent one to Drupal 8. The asset management system allows modules and themes to register libraries. Libraries define CSS style sheets and JavaScript files that need to be loaded with the page. Drupal 8 takes this approach for the frontend performance. Rather than loading all CSS or JavaScript assets, only those required for the current page in the specified libraries will be loaded.
In this recipe, we will define a libraries.yml file that will define a CSS style sheet and JavaScript file provided by a custom theme.
This recipe assumes that you have created a custom theme, such as the one you created in the first recipe. When you see mytheme in this recipe, use the machine name of the theme that you created.
css in your theme's base directory.css folder, add a style.css file that will hold the theme's CSS declarations. For the purpose of demonstration, add...Change the font size
Change margin width
Change background colour