The metadata contained within a theme's *.info.yml file helps to describe what type of document it is. In our case, it begins to describe a theme, including the name, description, and the version of Drupal the theme works with. Some metadata is required for the theme to function properly, so let's explore the keys in more detail as follows:
- name (required): This is the name of our theme.
- type (required): This is the type of extension (theme, module, or profile).
- base theme (required): This is the theme that the current theme is inheriting. In most cases, it is recommended that we reference either classy or stable as our base theme. If we choose not to reference a base theme, then we will need to set the value to false (base theme: false).
- description (required): This is the description of our theme.
- package (optional): This is used to group similar files when creating modules.
- version (optional): This is created by a packaging script.
- core (required): This specifies the version of Drupal that a theme is compatible with.
One of the most common mistakes when creating a *.info.yml file is forgetting to change the core value to 8.x. Failure to set this value will result in the theme not being displayed within the Appearance interface in the admin. The next section of a *.info.yml file allows us to manage assets (CSS or JS) using the new concept of libraries.