3

In Drupal 8 let's say I want to use a Bootstrap subtheme and the LESS starterkit described here: http://drupal-bootstrap.org/api/bootstrap/starterkits!less!README.md/group/subtheme_less/8

The Instruction there is to:

Download and extract the latest 3.x.x version of Bootstrap Framework Source Files into your new sub-theme. After it has been extracted, the folder should read ./subtheme/bootstrap.

Unfortunately this puts the Bootstrap source outside the ambit of my composer.json where I am managing my site dependecies and upgrade etc... more on why I want to do this here: https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/

So how can I include the bootstrap source required by my subtheme in the composer.json?

  • This Q/A is slightly related. No idea about sub-themes tough. – kaiser Apr 7 '16 at 2:32
2

composer require twbs/bootstrap ^3.3.6 --prefer-dist -vvv

Drupal Bootstrap requires 3.x.x the caret will stop us tripping into v4.

We don't want to include any git files so we do --prefer-dist.

This downloads the latest bootstrap source to vendor/twbs.

I can expose this dir to my subtheme by editing:

/themes/custom/MYSUBTHEME/less/bootstrap.less

Now when I run composer update I will get the latest bootstrap less in my subtheme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.