Problem/Motivation

Now Bootstrap 5 has a stable release,
There are a lot of differences between Bootstrap 4 and Bootstrap 5.
It's better to support Bootstrap 5 in bootstrap_styles to make all styles work as expected and to support new features.

Steps to reproduce

  • Check configuration files and replace old boostrap classes with new ones
  • Check Twig templates and make necessary changes
  • Check Javascript files and make necessary changes

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Abdullah Yassin created an issue. See original summary.

Abdullah Yassin’s picture

Version: 1.0.x-dev » 1.0.3
Abdullah Yassin’s picture

Abdullah Yassin’s picture

Status: Active » Needs review
Abdullah Yassin’s picture

Title: Support Bootstrap 5 » Support Bootstrap 5 on bootstrap_styles module
guido_s’s picture

Status: Needs review » Needs work

In some cases Bootstrap 5 also changed classes from "left" to "start" and "right" to "end".

#drupal-off-canvas .field-text-alignment .fieldset-wrapper > div > div input + label .input-icon[class*="left"],
#layout-builder-modal .field-text-alignment .fieldset-wrapper > div > div input + label .input-icon[class*="left"] {
  background-image: url("../../images/plugins/text-alignment/text-left.svg");
}

#drupal-off-canvas .field-text-alignment .fieldset-wrapper > div > div input + label .input-icon[class*="right"],
#layout-builder-modal .field-text-alignment .fieldset-wrapper > div > div input + label .input-icon[class*="right"] {
  background-image: url("../../images/plugins/text-alignment/text-right.svg");
}

So [class*="start"] and [class*="end"] need to be added. Maybe there are more cases like this.

guido_s’s picture

Version: 1.0.3 » 1.1.0
guido_s’s picture

I think this module should better get a complete refactoring for bootstrap 5.
Or maybe provide settings to select the bootstrap version in use and change the markup and styles accordingly.
Maybe some issues are already being worked on in other issues, but some of the problems I'm currently seeing are:

  • Replace sr-only with visually-hidden
  • Provide only one border radius and not different ones for all corners or at least don't render the sliders if no values for those were added in the settings as bs5 doesn't have classes for different corners
  • Use bootstraps markup for tooltips and don't provide custom code for this which looks broken on my site, maybe because it conflicts with bootstrap 5 css
  • Only provide styles for elements that were added by this module and not for the complete off-canvas (I am facing many styling issues and ugly looking elements due to changed off canvas variables and so on)
  • Maybe make use of bootstrap 5 css variables to keep colors and so on like defined in the theme like var(--bs-primary, some-default-value)

It's really hard to get a good looking, usable layout builder, especially as drupal core itself does some ugly things there by just reverting ALL styles inside layout builder, which causes huge UX issues on form widgets. So I'm very grateful for all the good ideas this module provides.

rajab natshah made their first commit to this issue’s fork.

rajab natshah’s picture

Version: 1.1.0 » 1.1.7
rajab natshah’s picture

StatusFileSize
new3.8 KB
rollins’s picture

I can confirm that the patch resolved the issue with Bootstrap 5

rajab natshah’s picture

Version: 1.1.7 » 1.2.x-dev
rajab natshah’s picture

Title: Support Bootstrap 5 on bootstrap_styles module » Support for Bootstrap 5

rajab natshah’s picture

Issue tags: +bootstrap_styles-1.2.3
rajab natshah’s picture

rajab natshah’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.