Quick start

Last updated on
30 April 2022

Get and install Drupal if needed

You need to install a couple of dependencies:

In order to quickly install Drupal and needed dependencies we recommend using a composer base installation approach:

composer create-project --stability=dev drupal/recommended-project:9.3.12 your-site-folder
cd your-site-folder

Edit composer.json, add replace repositories section with

    "repositories": {
        "packages_drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "jasny_bootstrap": {
            "type": "git",
            "url": "https://github.com/pivica/jasny-bootstrap.git"
        },
        "popper": {
            "type": "package",
            "package": {
                "name": "floating-ui/popper",
                "version": "v1.16.0",
                "type": "drupal-library",
                "dist": {
                    "type": "zip",
                    "url": "https://api.github.com/repos/floating-ui/floating-ui/zipball/9754fae6dae25265c7d60d1415c08782326b04f8",
                    "reference": "9754fae6dae25265c7d60d1415c08782326b04f8"
                }
            }
        },
        "bootstrap": {
            "type": "package",
            "package": {
                "name": "twbs/bootstrap",
                "version": "4.6.1",
                "type": "drupal-library",
                "dist": {
                    "type": "tar",
                    "url": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.1.tgz"
                }
            }
        }
    },

Add to 'extra' section:

"installer-types": ["component"],

Add to 'installer-paths' section:

            "web/libraries/jasny-bootstrap": [
                "jasny/bootstrap"
            ],

and change minimum-stability to dev:

    "minimum-stability": "dev",

Save changes to composer.json and then execute:

composer require drupal/bs_lib drupal/bs_base drush/drush jasny/bootstrap twbs/bootstrap floating-ui/popper

Create database and install Drupal:

echo 'create database your_database' | mysql -u root
drush si standard install_configure_form.enable_update_status_emails=NULL --site-name='Your Site' --db-url=mysql://root@localhost/your_database -y

Enable dependencies and generate a new theme

drush en bs_lib
drush then bs_base bs_bootstrap
drush bs-tc bs_bootstrap your_theme 'Your Theme Name' 'Your Theme Description.'

And that's it. Your custom theme is generated and you can start having fun with it :)

Make sure to have node, pnpm or npm and gulp-cli installed on your system before using drush generator. Check the Installation section for more details.

Usual tasks

Manually compile your SASS code

cd themes/custom/your_theme
npx gulp sass

Compile dev version of CSS

npx gulp sass:dev

Compiling dev version of CSS will inject source maps into your CSS which allows you to easily debug CSS, see related SASS code and figure which SASS variables you need to override.

Update theme

drush bs-tu your_theme

Updating theme with a drush bs-tu command should always be done when you update to the latest version of bs_base.

Help improve this page

Page status: No known problems

You can: