3

How do I create a sub-theme using Drupal Console or Drush 9?

I looked at Creating a Drupal 8 sub-theme, or sub-theme of sub-theme and the documentation of drupal generate:theme, but I didn't find anything about creating a sub-theme from CLI.

My aim is to automatize the process with a CLI. Is it possible now?

1
  • Seems like you have to create a custom Drush or Drupal console command.
    – ya.teck
    Apr 14 '18 at 9:08
5

The option exists in Drupal Console's drupal generate:theme; it's done by specifying the --base-theme option in the command. The option's value adds the base theme key with option's value into the generated theme's .info.yml file (which make the new theme a sub theme).

4

The third question asked when you run drush generate theme is "Base Theme [classy]"

You can specify the machine name of the parent theme there.

Not the answer you're looking for? Browse other questions tagged or ask your own question.