How to Create a Custom Theme in Varbase

About the Author

Raghad Eid

Content Writer

Raghad Eid is a content strategist at Vardot, a Drupal Diamond Certified Partner and Drupal AI Initiative Gold Sponsor. She writes on enterprise CMS architecture, headless Drupal, and digital experience platforms.

FAQs

Create a custom theme in Varbase 11 by generating a sub-theme from Vartheme BS5 with Drupal core's generate-theme script: run "php core/scripts/drupal generate-theme mytheme --starterkit vartheme_bs5 --path themes/custom" from the docroot. Set the new theme as default, uninstall Vartheme BS5, then install and compile its assets with Yarn.

No. Varbase 11 themes are built with webpack, run through Yarn script aliases, not Gulp. Use "yarn theme:full-build" to compile SCSS, JavaScript, and icons, "yarn theme:watch" to recompile on change during development, and "yarn components:build" to compile custom Single Directory Components only.

Vartheme BS5 is the default Bootstrap 5 front-end theme for Varbase 11. It provides a responsive grid, SCSS with variable overrides, Single Directory Components, and CVA variant management. A custom Varbase theme is generated as a sub-theme of Vartheme BS5, inheriting this architecture out of the box.

Varbase Components migrates component references automatically when you set a generated theme as default. Its Active Theme Change Subscriber updates Canvas component IDs, content templates, entity field data, and version hashes. If it does not run, the drush commands varbase-components:switch-theme and varbase-components:fix-versions perform the same migration manually.

Use Yarn for Varbase theme tooling. The theme's package list is optimized for Yarn, and running npm install can cause installation problems. After generating a theme, run "yarn install" then "yarn theme:init" once, and use the theme's yarn build aliases to compile styles and components.

Join the conversation +