Problem/Motivation
Vartheme BS4 provides a shell script to generate a sub-theme. Radix provides a Drush command and a kit. Currently, there's no documentation, script, or Drush command for creating a Vartheme BS5 sub-theme.
Proposed resolution
- Provide documentation
bash script, and/or Drush command for creating a Vartheme BS5 sub-theme.- Allow starterkit theme generator tool to clone Vartheme BS5
, much like #3301173: Allow starterkit theme generator tool to clone Olivero
base theme: false starterkit: true
Remaining tasks
- ✅ File an issue about this project
- ✅ Addition/Change/Update/Fix to this project
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ✅ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ✅ Accessibility and Readability
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Update Release Notes and Update Helper on new feature change/addition
- ✅ Release Varbase 10.0.0-alpha2, vartheme_bs5-3.0.0-alpha3
Varbase update type
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Issue #3313097: Allowed starterkit theme generator tool to clone Vartheme BS5
How to use the Vartheme BS5 Starterkit
To generate a new theme from Vartheme BS5 using the starterkit/theme-generation script, run the following from Drupal's installation root:
cd PROJECT_DIR_NAME/docroot
Run the following Drupal Generate Theme script:
php core/scripts/drupal generate-theme new_theme_name --starterkit vartheme_bs5
Additionally, you can create the theme's human-readable name and it description with two optional arguments:
php core/scripts/drupal generate-theme new_theme_name
--starterkit vartheme_bs5
--name "New Theme Name"
--description "Custom theme generated from Vartheme BS5 theme"
This script will copy over all the files from the Vartheme BS5 theme, and replace instances of Vartheme BS5's machine name and label with the strings you provide.
Customizing CSS
The new theme should look and function identically to Vartheme BS5 out of the box, but the styles could be changed to suit the project's needs. Vartheme BS5's styles are written using Bootstrap 5, SASS, PostCSS, which is installed and configured Varbase, and allows CSS authors to write modern CSS while still supporting browsers that have not fully implemented the newest methodologies.
As part of the generate-theme command, the necessary package.json dependencies and scripts files are copied over for the project. Simply install the dependencies and then run yarn theme:init once, and then either the yarn theme:full-build command to compile the assets once or the yarn theme:watch command to re-compile the assets every time a .scss file is changed.
yarn install # Install the dependencies
yarn theme:init # Initialize the theme once
yarn theme:full-build # Compile SASS once
yarn theme:watch # Compile SASS per save
Comments
Comment #2
jcandan commentedRadix #3095843 has the beginnings of a webpack script to automate kit generation to avoid the kit going stale.
Though, as a result of Change record: New starterkit theme generator, I wonder if this theme should be converted to a "starter theme" to take advantage of the core provided script.
Comment #3
rajab natshahComment #4
rajab natshahThanks, James for the hint
Vartheme BS5 is a starterkit theme for Bootstrap 5
No longer needs any parent theme
Moving with the Drupal core team on using the Drupal core
theme generator ( or a like )
Having a script for starter-kit generator , much like #3301173: Allow starterkit theme generator tool to clone Olivero
A new theme for a project will be managed by a clone/rename/replace naming for the project.
Using the starterkit core generator.
As of
#3357708: Start a 3.0.x branch to support Single Directory Components (SDC) with Drupal ~10.1.0 in Vartheme BS5
Comment #5
rajab natshahComment #6
rajab natshahComment #7
rajab natshahComment #10
rajab natshahHow to use the Vartheme BS5 Starterkit
Comment #11
rajab natshahComment #12
rajab natshahComment #13
rajab natshahComment #14
rajab natshahComment #15
rajab natshah✅ Released vartheme_bs5-3.0.0-alpha3
Comment #16
rajab natshahComment #17
rajab natshah✅ Released Varbase 10.0.0-alpha2