Bootstrap is an incredibly popular option for creating Drupal themes.
Using the Bootstrap CDN allows you to quickly and flexibly add custom code that overrides the Bootstrap defaults. This is a great way to make your own Drupal theme based on Bootstrap.
In this tutorial, we will demonstrate how to create a Drupal 8 subtheme that uses the Bootstrap CDN.
- Firstly, you will need to download, install and enable the Bootstrap theme.
- Now open the Bootstrap folder, enter the starterkits folder and copy the CDN folder.
- Place the /cdn/ folder in the main /themes/ folder next to /bootstrap/:
- Now rename the /cdn/ folder with the name you want to give your theme. For this tutorial, I will simply call it /subtheme/.
- Now we need to replace THEMENAME with subtheme in the following files:
- The starterkit file is slightly different and needs to be renamed from /THEMENAME.starterkit.yml to /subtheme.info.yml
- Now open subtheme/subtheme.info.yml in your editor of choice. I recommend Atom.
- Again update the ‘THEMETITLE’ and description with the details of your theme.
- Now open the schema file inside config and update the label
- Now go back to the “Appearance” tab in your Drupal site.
- Scroll down to the uninstalled themes section and we should see “subtheme”.
Install and set as the default theme and you are ready to start customising your own theme.