Skip to content
Snippets Groups Projects
Commit ff569f0f authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3159290: Change the script generator to create new Vartheme BS4 sub...

Issue #3159290: Change the script generator to create new Vartheme BS4 sub theme ( Bootstrap 4 ) SASS
parent 017575af
No related branches found
No related tags found
No related merge requests found
# Varbase Scripts # Varbase Scripts
## Quick tip on how to use this script command file. ## Vartheme BS4 Scripts
### Quick tip on how to use this script command file.
Default settings could be changed in scripts.settings.yml Default settings could be changed in scripts.settings.yml
...@@ -18,8 +20,17 @@ $ apt install build-essential ...@@ -18,8 +20,17 @@ $ apt install build-essential
$ curl -L https://npmjs.com/install.sh | sh $ curl -L https://npmjs.com/install.sh | sh
$ apt install npm $ apt install npm
``` ```
### Install Yarn
```
sudo apt update && sudo apt install yarn
```
or Install Yarn as a global by npm
```
npm install -g yarn
```
* 2. Gulp : Helps compiling SASS to CSS * 2. [Gulp](https://gulpjs.com) : Helps compiling SASS to CSS
``` ```
npm install gulp-cli -g npm install gulp-cli -g
npm install gulp -D npm install gulp -D
...@@ -30,10 +41,16 @@ After we make sure that we do have all the tools we could change directory ...@@ -30,10 +41,16 @@ After we make sure that we do have all the tools we could change directory
in the terminal to: in the terminal to:
``` ```
$ cd PROJECT_DIR_NAME/docroot/profiles/varbase/scripts $ cd PROJECT_DIR_NAME/docroot/themes/contrib/vartheme_bs4/scripts
$ bash ./create-new-vartheme-bs4.sh "THEME_NAME" $ bash ./create-new-vartheme-bs4.sh "THEME_NAME"
``` ```
We can use
```
$ cd PROJECT_DIR_NAME/docroot/themes/contrib/vartheme_bs4
yarn theme:create-sub-theme "THEME_NAME"
``
* Activate your new sub theme by going to Appearance in our Varbase site. * Activate your new sub theme by going to Appearance in our Varbase site.
* Search for THEME_NAME of the generated new sub theme and click on Install * Search for THEME_NAME of the generated new sub theme and click on Install
and set as default. and set as default.
...@@ -54,28 +71,42 @@ $ gulp ...@@ -54,28 +71,42 @@ $ gulp
[10:55:43] Finished 'move_popper_js_files' after 3.89 ms [10:55:43] Finished 'move_popper_js_files' after 3.89 ms
[10:55:43] Starting 'watch'... [10:55:43] Starting 'watch'...
``` ```
We can use
```
yarn theme:init
```
We may want to increase our maximum watched SASS files by We may want to increase our maximum watched SASS files by
``` ```
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p $ echo fs.inotify.max_user_watches=524288
| sudo tee -a /etc/sysctl.conf && sudo sysctl -p
``` ```
-------------------------------------------------------------------------------- Then run gulp compile ones to compile every time we want.
# Create new Vartheme sub theme ( Bootstrap 3) LESS ```
$ cd PROJECT_DIR_NAME/docroot/themes/custom/THEME_NAME
$ gulp compile
[11:22:30] Using gulpfile PROJECT_DIR_NAME/docroot/themes/custom/THEME_NAME/gulpfile.js
[11:22:30] Starting 'compile'...
[11:22:33] Finished 'compile' after 2.54 s
```
We can use
```
yarn theme:build
```
Or run gulp watch to keep watching for changes.
### For left to right (LTR) sub-theme
``` ```
cd PROJECT_DIR_NAME/docroot/profiles/varbase/scripts $ cd PROJECT_DIR_NAME/docroot/themes/custom/THEME_NAME
bash ./create-new-vartheme.sh "THEME_NAME" "ltr" $ gulp watch
[11:25:53] Using gulpfile PROJECT_DIR_NAME/docroot/themes/custom/THEME_NAME/gulpfile.js
[11:25:53] Starting 'watch'...
``` ```
We can use
### For right to left (RTL) sub-theme
``` ```
cd PROJECT_DIR_NAME/docroot/profiles/varbase/scripts yarn theme:watch
bash ./create-new-vartheme.sh "THEME_NAME" "rtl"
``` ```
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
...@@ -155,7 +155,7 @@ if [[ ! -d "$theme_path/$theme_name" ]]; then ...@@ -155,7 +155,7 @@ if [[ ! -d "$theme_path/$theme_name" ]]; then
# 12. Install needed libraries # 12. Install needed libraries
cd ${theme_path}/${theme_name}; cd ${theme_path}/${theme_name};
npm install yarn global ; npm install -g yarn ;
yarn install ; yarn install ;
generated_datetime="$(date '+%Y/%m/%d - %H:%M:%S')"; generated_datetime="$(date '+%Y/%m/%d - %H:%M:%S')";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment