Creating Your Own Theme
Last updated
Last updated
After building and installing the project with the Varbase Project template, use the create new Vartheme sub theme command.
Before that have a look at:
Learn more about Bootstrap standard build tools documentation, compile source code, run tests, and more.
https://getbootstrap.com/docs/4.0/getting-started/build-tools/
Open a terminal window.
Change directory in the terminal to docroot/themes/contrib/vartheme_bs4/scripts
in the project.
Run the bash ./install-needed-tools.sh
Follow with the list of instructions.
Recommended doing the installation of needed tools using the bash script command. But if that is not the case. By deciding to manually install custom versions. Please follow with the following steps.
Helps with string replace and re-naming files.
Helps getting more development tools and the Bootstrap and popper packages.
Install Yarn as a global by npm
Helps in managing tasks when compiling SASS/SCSS to CSS
Open a terminal to run commands
Change directory in the terminal to docroot/themes/contrib/vartheme_bs4/scripts
Run the create-new-vartheme-bs4.sh "THEME_NAME"
. Change the THEME_NAME
to the project name or any selected theme name.
If a Varbase site named "mysite" was built using the following command:
The folder mysite for the project is located at "/var/www/html/mysite"
Change directory to docroot/themes/contrib/vartheme_bs4/scripts
Run the following bash
command to create a custom theme named "mytheme"
The new theme will be located at "/var/www/html/mysite/docroot/themes/custom/mytheme"
When the finishes the following message will show up in the terminal
Go to Appearance in the administration of the Varbase site.
Search for the name of the newly generated theme
Click on Install and set as default.
Navigate to the home page to check if the new theme is the default theme.
First step to do after creating a new theme.
Change directory to the new theme in the terminal then run only gulp
without arguments.
Run this command ones after creating a new sub theme
Run it again ones after updating the Bootstrap 4 library with yarn install
or with Yarn
For example change the color value for the primary color in scss/bootstrap-variables.scss
file to test compiling SASS files to CSS
Then run gulp compile
ones to compile every time the SCSS source changes.
or with Yarn
Increase maximum watched SASS files by
Run gulp watch
to keep watching for changes. This command will auto compile on each save of changes for SCSS files.
or with Yarn
On the state of working in a team in a project, the created theme could be don by other member of the team.
When the theme get committed by git for example, the node_modules
folder will not be committed. As it is listed in the .gitignore
file.
After cloning a project with a Vartheme Sub theme.
Run the following commands to get all development tools