How to
Sub-themes are just like any other theme, with one difference: they inherit the parent theme's resources.
There are no limits on the chaining capabilities connecting sub-themes to their parents. A sub-theme can be a child of another sub-theme, and it can be branched and organized however you see fit.
This is what gives sub-themes great potential.
We don't want to make edits to our base theme: in case of an update to this theme, we would lose our changes.
So we use a Sub-theme that automatically inherits everything from the base theme. We can then customise our Sub-theme without hacking the base theme.
Some themes - such as bootstrap, omega, zurb foundation - include a starterkit.
A starterkit is basically a ready-made sub-theme, specifially created with the base theme in mind.
When you encounter a theme with a starterkit, follow the instructions usually found in the themes README.md file.
In the next example we will see how to manually create a sub-theme, not based on a starterkit.
Any theme can be used as a starting point for a new sub-theme.
Suggested starter base themes:
Not practical for this guide:
The name must be like a machine name:
This is your theme (machine_)name from now on!
name: 'Pieters Classy theme'
type: theme
description: 'Custom sub-theme that extends classy'
core: '8.x'
base theme: classy
libraries:
- pietermathys_classy/base
base:
css:
theme:
css/style.css: {}
js:
js/custom.js : {}
dependencies:
- core/jquery
- core/drupal
Through the dependencies we load default drupal JS & jQuery
You can add a logo in SVG format directly to the theme.
If you don't have an SVG logo, then upload the logo through the appearance tab in Drupal Admin.
You can customise the image used on the appearance tab by adding a screenshot.png file to the theme folder:
Time to look at the result and either:
1) Cry cause it's not working
2) Rejoice & start styling