Relative path to bootstrap5/scss/style[.scss] is wrong

Created on 6 November 2023, about 1 year ago
Updated 22 March 2024, 8 months ago

Problem/Motivation

I am using a fresh, clean Drupal 10.1.6 installation and likewise the Bootstrap5 theme (3.0.10).

I have created a sub-theme via the UI as prescribed.

When I look into my sub-theme's custom/my_subtheme/scss/style.scss file, I see the following last line...

@import '../../../themes/contrib/bootstrap5/scss/style';

I think the relative path is wrong and should actually be pointing the contrib theme's style[.scss] file one level up at...

@import '../../../../themes/contrib/bootstrap5/scss/style';

Consequently, the SASS compile could not ever work with my sub-theme.

Unless I've got it all wrong then I fail to see how anyone creating a subtheme via the UI could customise there SCSS successfully and then compile it - or maybe I really have got it all wrong?!

Thanks to PHP Storm for highlighting the error...

Thanks

🐛 Bug report
Status

Postponed: needs info

Version

3.0

Component

Miscellaneous

Created by

🇬🇧United Kingdom SirClickALot Somerset

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

Comments & Activities

  • Issue created by @SirClickALot
  • 🇮🇳India ravi kant Jaipur

    @SirClickalot
    The extention is not required during import sass file.
    May be issue due to other mistake.

  • 🇬🇧United Kingdom SirClickALot Somerset

    It's definitely needed if you wish to override Bootstrap variables using SASS.

  • 🇬🇧United Kingdom SirClickALot Somerset

    I have just installed a fresh Drupal 10 site and added the very latest BS5 theme (3.0.11) and created a new sub-theme via the UI.
    I am certain that this is an error with the theme.

    To clarify, if you create a sub-theme via the UI in the default place (i.e. /themes/custom) then the file...

    themes/custom/b5subtheme/scss/style.scss

    ...has it's reference back to contrib' theme's style.scss is wrong.

    It is set to...

    // Include bootstrap.
    @import '../../../themes/contrib/bootstrap5/scss/style';

    When it should be...

    // Include bootstrap.
    @import '../../../../themes/contrib/bootstrap5/scss/style';

    That is to say one level up.

  • 🇮🇳India ravi kant Jaipur

    @SirClickalot
    I did not find issue with Bootstrap5 theme version as mention and created subtheme from UI.
    I try to debug and created screenshot for better expiation.
    Let me know if i am wrong somewhere.

  • Status changed to Postponed: needs info 8 months ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    @SirClickalot seems like PHP storm misconfigured. My cli sass works fine.

  • 🇬🇧United Kingdom SirClickALot Somerset

    OK, I'm clearly outvoted here!
    I'll go and check on what's going on with my PHP Storm.

    Thanks both.

Production build 0.71.5 2024