Theme Template
This is a basic Drupal theme template. To use it:
- Copy this directory to your Drupal installation:
themes/custom/yourthemename/ - Rename files from
THEMENAME.*toyourthemename.* - Replace all instances of
THEMENAMEwith your theme's machine name (lowercase, underscores) - Replace all instances of
THEMELABELwith your theme's human-readable name - Customize the theme as needed
Files Included
THEMENAME.info.yml- Theme metadataTHEMENAME.libraries.yml- CSS/JS library definitionsTHEMENAME.theme- Theme functions and preprocessingtemplates/page.html.twig- Page templatecss/base/reset.css- Base CSS resetjs/custom.js- Custom JavaScript
Directory Structure
THEMENAME/
├── THEMENAME.info.yml
├── THEMENAME.libraries.yml
├── THEMENAME.theme
├── css/
│ └── base/
│ └── reset.css
├── js/
│ └── custom.js
└── templates/
└── page.html.twig
You can expand the CSS structure as needed:
css/
├── base/
│ └── reset.css
├── layout/
│ └── layout.css
├── components/
│ └── components.css
└── theme/
└── theme.css
Next Steps
After creating your theme:
- Clear cache:
ddev drush cr - Enable your theme: Go to
/admin/appearance - Set as default theme
- Start customizing!
Development Tips
- Enable Twig debugging in
sites/default/services.yml - Disable CSS/JS aggregation during development
- Clear cache frequently:
ddev drush cr - Use template suggestions for specific pages/content types