How to start a new theme
Last updated on
2 November 2023
A new theme named my_new_theme can be generated by following the next steps:
-
Clone “The Governor” theme in the “web/themes/custom/” folder. (This step will be replaced by composer require in the future.)
-
Run the generate-theme command from the root the project:
php web/core/scripts/drupal generate-theme my_new_theme --name "My New Theme" --description "Custom theme generated from The Governor" --path "themes/custom" --starterkit=governor -
Navigate to your new generated theme:
cd web/themes/custom/my_new_theme -
Install the theme dependencies:
npm install -
Run the init command to copy the USWDS assets and compile the styles:
npm run init -
Clear cache:
drush cr -
Enable your new theme and enjoy.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion