I created my own theme which uses the Bootstrap front-end toolkit, and I want to use the Bootstrap SCSS mixins like @include media-breakpoint-up(md) as well as doing things like modifying the default colors. I have this working by adding the Bootstrap SCSS source files (from https://getbootstrap.com/docs/4.6/getting-started/download/) in user/themes/MYTHEME/scss/bootstrap-4.6.0 (approx 90 files) and then putting this in my theme.scss (which is referenced in base.html.twig after being compiled):
@import 'bootstrap-4.6.0/bootstrap';
I can now do things like:
$margin-below-navbar: 96px;
$margin-below-navbar-md: 56px;
.main {
margin-top: $margin-below-navbar;
@include media-breakpoint-up(md) {
margin-top: 56px;
}
}
Beautiful (at least to my immature CSS eyes)!
This is working but I don't need those 90 Bootstrap SCSS files on my server once they are compiled by the SASS compiler, so I thought maybe I should download Bootstrap with composer instead (composer require twbs/bootstrap:4.6.0, for example).
This caused two problems. First, I had to update composer from 2.0.9 to 2.0.12 or above because the new Github tokens were not compatible (see bug #9757 - https://getcomposer.org/changelog/2.0.12). Running composer self-update took it to 2.1.3.
Second, when I ran the composer require command, over 2400 files were added or changed in the vendor directory, mostly nothing to do with Bootstrap.
So I've gone from 90 files too many to over 2400 too many 😦
I started thinking - do I need the vendor directory on the server? Do I even need it in my version control if it can be generated by composer? Or at worst, can I just not commit the latest updates in the vendor directory and leave it as it came with grav-admin v1.75 in Feb 2021 + the upgrade to v1.7.10 in April 2021?