I created my custom module(contact_form) but I don't know How to theme this form? How to create a template or how to add CSS in my form? I have my CSS and JS.
Asked
Active
Viewed 814 times
1 Answers
0
can you check drupal.com documentation :https://www.drupal.org/developing/api/8/assets
The general steps for loading assets (CSS/JS) are:
1. Save the CSS or JS to a file. 2. Define a "library", which can contain both CSS and JS files. 3. "Attach" the library to a render array in a hook.
But in the case of themes, there is an alternative to step 3: themes can choose to load any number of asset libraries on all pages.
check this stackoverflow answer: https://stackoverflow.com/a/37723273/1153703
you can also check the costume theme example I fount here : http://wiki.workassis.com/drupal-8-custom-theme-from-scratch/