I am using this sub-theme. So I open the problem here, because it's a real puzzle and I can't find any help.
https://www.drupal.org/docs/8/themes/barrio-bootstrap-4-drupal-89-theme/... →
https://www.drupal.org/docs/contributed-themes/bootstrap-4-sass-barrio-s... →
I am currently using Bootswatch Flatly in CDN mode. I want to put everything locally.
https://bootswatch.com/flatly/
Here is what I did :
1) I ran the following 2 commands on my server :
mkdir -p web/libraries/bootstrap
cp -R vendor/twbs/bootstrap/dist web/libraries/bootstrap
2) I modified the bootstrap_subtheme_front_office.info.yml
file :
name: Bootstrap Subtheme Front Office
type: theme
description: 'SASS starter kit for a Bootstrap Barrio SubTheme.'
# version: VERSION
core: 8.x
core_version_requirement: ^8 || ^9
base theme: bootstrap_barrio
libraries:
- bootstrap_subtheme_front_office/bootstrap
- bootstrap_subtheme_front_office/global-styling
libraries-override:
bootstrap_barrio/global-styling: true
bootstrap_barrio/file: true
regions:
navigation_collapsible_first: 'Navigation (Collapsible first)'
navigation_collapsible_left: 'Navigation (Collapsible left)'
navigation: 'Navigation'
navigation_collapsible_right: 'Navigation (Collapsible right)'
navigation_collapsible_second: 'Navigation (Collapsible second)'
breadcrumb: 'Breadcrumb'
header: 'Top Bar'
sidebar_first: 'Primary'
highlighted: 'Highlighted'
help: 'Help'
content: 'Content'
sidebar_second: 'Secondary'
footer: 'Footer'
# Information added by Drupal.org packaging script on 2020-10-11
version: '5.0.2'
project: 'bootstrap_subtheme_front_office'
datestamp: 1602444143
I modified the bootstrap_subtheme_front_office.libraries.yml
file :
global-styling:
version: VERSION
js:
js/popper.min.js: {}
js/bootstrap.min.js: {}
js/barrio.js: {}
js/custom.js: {}
js/back-to-top.js: {}
js/copy-to-clipboard.js: {}
css:
component:
css/style.min.css: {}
dependencies:
- core/jquery
- core/drupal
bootstrap:
js:
/libraries/bootstrap/dist/js/bootstrap.bundle.min.js: {}
css:
component:
/libraries/bootstrap/dist/css/bootstrap.min.css: {}
3) I downloaded the 4 Bootswatch Flatly files to my computer (see screenshot).
I copied the 4 files in the folder /libraries/bootswatch/dist/flatly
4) I executed the gulp
and drush cr
command.
MY PROBLEM
I don't understand anything about Barrio. It's complicated, it goes all over the place.
There are duplicate files everywhere and no instructions.
The documentaion says to download the library with NPM. It also says that the library is downloaded automatically by Composer and that it should be copied into the "libraries" folder.
In the SASS sub-theme there is a CSS folder which already contains bootstrap.min.css
and a JS folder which already contains bootstrap.min.js
and popper.min.js
Which file should be used? How to put Bootswatch locally ?