Generate your theme
The only thing you need to do is run the following command from your project root, replacing lollapalooza with your theme's machine name:
ddev create-theme lollapaloozaThe command automatically handles everything:
- Generates a new theme based on the Webhaven starterkit
- Installs its Node dependencies
- Creates
.env.localwith your project's DDEV URL - Enables the theme and sets it as the default
- Migrates Canvas components to your new theme
- Clears caches
Tip: enable dev mode (ddev dev-mode) while theming. It turns off caching and CSS/JS aggregation and enables Twig debug, so you see your changes immediately.
Build your theme
To compile all files and watch for changes with BrowserSync run:
npm run watchTo build for development run:
npm run devTo build for production run:
npm run buildLinting and formatting
Linting checks your code for errors and bad practices. Formatting automatically rewrites your code to a consistent style. Running these regularly keeps your theme code clean and maintainable.
To format and lint your JavaScript and component files:
npm run biome:checkOr run them separately:
npm run biome:format
npm run biome:lintTo lint your SCSS files run:
npm run stylintTo automatically fix SCSS lint issues run:
npm run stylint-fix