How to put the Bootswatch theme locally ?

Created on 22 January 2021, about 4 years ago
Updated 7 August 2023, over 1 year ago

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 ?

💬 Support request
Status

Needs review

Version

5.0

Component

Documentation

Created by

🇫🇷France zenimagine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India ravi kant Jaipur

    Bootswatch theme can include form theme setting page.
    Steps -
    1. Appearance Page
    2. Click on "Settings" link of this theme. This theme should be default theme.
    3. scroll bottom of theme settings page.
    4. find "Load library"
    5. Choose "Bootswatch Flatly" library

    This option will not show if you are using bootstrap_library module

  • Status changed to Needs review over 1 year ago
Production build 0.71.5 2024