Bootstrap being loaded twice?

Created on 22 August 2023, 10 months ago
Updated 23 September 2023, 9 months ago

I am in the process of updating my Base theme from Bootstrap to Bootstrap Barrio. I have also managed to enable the bootstrap_sass module and then use the included script to set up my barrio subtheme.

I have also installed twitter bootstrap from npm using composer installer extender. This now sits in my library.

I have also installed (npm install) any dependencies in my subtheme.

The issue I am having is that I see bootstrap is being loaded First from /libraries/
bootstrap/scss/_grid.scss:15:5? (originally /libraries/bootstrap/dist/css/bootstrap.min.css?) and again from /themes/ custom/mysubtheme_bootstrap_sass/node_modules/bootstrap/scss/_grid.scss (originally themes/
custom/mychildtheme_bootstrap_sass/css/style.css)?

How do I disable this behaviour as I only want to load it once?

πŸ’¬ Support request
Status

Closed: outdated

Version

5.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 2dareis2do

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

Comments & Activities

  • Issue created by @2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡΅πŸ‡ͺPeru hatuhay Lima

    On the theme's configuration form disable library load

  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do

    Yes thanks for clarifying.

    If I understand correctly I can do this from both the parent and child themes, then gulp is usually used to compile everything that is installed in the child theme.

    Alternatively, I think I could probably disable compiling any libraries with gulp and then simply compile any required components and add any overrides that I require in my child theme while inheriting from the precompiled version in the libraries folder which I think that is more in line with how Bootstrap 3 works

    Certainly I am of a fan of using composer installers extender to manage my js dependencies and one benefit of that approach is it makes it easy to update bootstrap version along with everything else.

    I guess I am really wondering what was the main reasoning behind this alternative approach which seems a little unintuitive based on my limited experience of working with other Drupal themes and how they inherit from one another.

  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do

    ok I think I see one issue is that when compiling any sass it bario_bootstrap parent it requires the bootstrap variables and mixins first.

    Removing libraries installation and will just use the child theme for managing bootstrap version.

    Thanks

  • Status changed to Closed: outdated 9 months ago
  • πŸ‡΅πŸ‡ͺPeru hatuhay Lima
Production build 0.69.0 2024